Hello dear Coders,
I have a problem in Windows Forms. I've created a form where I can click on the search-Button to show another form with the following code:
Private Sub btnSearchUser_Click(sender As Object, e As EventArgs) Handles btnSearchUser.Click If Me._clsfrmChild Is Nothing Then Me._clsfrmChild = New clsFrmChild End If If Me._clsfrmChild.Visible = False Then Me._clsfrmChild.ShowDialog(Me) End If
In the second form I have a MaskedTextbox:
I want to save the value which will be entered but the MaskedTextBox can remain empty as well. But it doesn't matter if the MaskedTextBox is filled or empty.
Whatever I do, if I close the second form with "Visible = False" and reopen it again, the MaskedTextbox looks like this:
I close the second form that way:
Private Sub btnAbort_Click(sender As Object, e As EventArgs) Handles btnAbort.Click Me.Visible = False End Sub
Does someone of you know why this problem is caused?
I think the problem has to be with ShowDialog(Me) but I can't replace ShowDialog() because it is required.