I have a windows project with two forms in it. On form1 one I have a linkbutton to be able to open form2. When form2 is opened I want to hide form1 and then show form2. On form2 there are some text boxes asking for information and a submit button. When the submit button is clicked I do some validation of the text in the text boxes. This is where the problem comes in - If I find an issue with the text in a text box I flag the text box in question with an error provider and pop up a message box explaining what is wrong. As soon as I click ok on the message box, form2 goes away and form1 comes back. I need form2 to stay active so that it can be filled out properly. How do I accomplish this?
Here is my code for opening form2
My text validation for each text box is handled by a function. If the function returns pass, I update my database with some information. If it returns fail, then the sub routine ends. It’s when the sub routine ends that form2 goes away and form1 comes back. Please help, thanks.
Here is my code for opening form2
VB.NET:
Dim nf As New frmNotFound
Private Sub LinkLabel1_LinkClicked(ByVal sender As System.Object, _
ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
Me.Hide()
nf.FromInformation(user, asset, compname, messid, ip2)
nf.ShowDialog(Me)
Me.Show()
End Sub
My text validation for each text box is handled by a function. If the function returns pass, I update my database with some information. If it returns fail, then the sub routine ends. It’s when the sub routine ends that form2 goes away and form1 comes back. Please help, thanks.