Closing a form
-
Hi all, iam havin a hard time figuring out how can i close a form which calls another form... its like a log in form calling the main form after validating the log in parameters. my code goes like this... dim form2bcalled as new form2bcalled form2bcalled.show() me.close() what happens after this codes is that the entire project close... leading me back to the design state. thanks in advance guys... Cheers. "computers are the lousy actors, and programmers are the playwright..."
-::maximus::-
-
Hi all, iam havin a hard time figuring out how can i close a form which calls another form... its like a log in form calling the main form after validating the log in parameters. my code goes like this... dim form2bcalled as new form2bcalled form2bcalled.show() me.close() what happens after this codes is that the entire project close... leading me back to the design state. thanks in advance guys... Cheers. "computers are the lousy actors, and programmers are the playwright..."
-::maximus::-
Option Strict On
Module basMain
Public WithEvents frmParent As New Form1 'project startup form
Public WithEvents frmLogin As Form2 'login formSub Main() 'prompt user for login first frmLogin = New Form2 'create a new instance of the form Application.Run(frmLogin) Application.Run(frmParent) End Sub
End Module
-
Option Strict On
Module basMain
Public WithEvents frmParent As New Form1 'project startup form
Public WithEvents frmLogin As Form2 'login formSub Main() 'prompt user for login first frmLogin = New Form2 'create a new instance of the form Application.Run(frmLogin) Application.Run(frmParent) End Sub
End Module
owkei... ill try this one... thanks alot
-::maximus::-
-
Hi all, iam havin a hard time figuring out how can i close a form which calls another form... its like a log in form calling the main form after validating the log in parameters. my code goes like this... dim form2bcalled as new form2bcalled form2bcalled.show() me.close() what happens after this codes is that the entire project close... leading me back to the design state. thanks in advance guys... Cheers. "computers are the lousy actors, and programmers are the playwright..."
-::maximus::-
Also check the projects properties. The "Shutdown Mode" is probably set to "When startup form closes". You can change this to "When last form closes".