What's wrong with
Form.Show
,
Form.Hide
?
Here:
http://msdn.microsoft.com/en-us/library/system.windows.forms.form.aspx[
^].
However, I feel the abuse in your application design, which is only natural for a person who did not yet hide or show a form. Chances are, you will need to review it. You could get more help if you explain why would you do it.
[EDIT]
After OP's clarification:
It's wasn't a good idea to hide one form and show another. Why hiding one form if you are not going to use it any longer. One pattern would be like this:
Dim mainForm As Form = New FormMain()
Dim loginForm As Form = New FormAuthentication()
loginForm.ShowDialog()
If loginForm.AuthenticationFailed Then
Return
End If
Application.Run(mainForm)
In more complex variants of it, you can give a user few attempts, etc...
—SA