Close previous form

jamie_pattison

Well-known member
Joined
Sep 9, 2008
Messages
116
Programming Experience
Beginner
A little bit of a strange issue that i thougt would have been straight forward.

I have two forms. 1 a login form, 2 The default application.

I would like the user to be verified by form 1 (Login Form) and if verified to open up form 2 (Default Application). I cant get this to work....

My code is as follows

Login form code

Private Sub OpenDefaultApplication
Dim defApp As DefaultApplication
defApp = New DefaultApplication(Me)

defApp.Show()
End Sub

DefaultApplication code

Public Sub New(ByRef LoginForm As Form)

' This call is required by the designer.
InitializeComponent()

' Add any initialization after the InitializeComponent() call.
_LoginForm = LoginForm
_LoginForm.Close()
End Sub

This seems to close both forms.... Any way to get around this?

Thanks
 
Back
Top