mdak002 Posted October 13, 2003 Posted October 13, 2003 Ok so this seems like a really easy question and Im sure there's an obvious answer but how the heck do I open a new form (form2) and close the first one (form1). Form1 is the form that is first loaded when the program starts. I tried to do Dim frm2 as new form2 frm2.show Me.close but the application just closes alltogether. Any help would be appreciated thanks. Quote
*Experts* mutant Posted October 13, 2003 *Experts* Posted October 13, 2003 The application closes all together because the first form is the form that your application loop depends on. What you could do for example it hide that form. Quote
loyal Posted October 14, 2003 Posted October 14, 2003 hi just add a Module from project Menu give it a name for example StartModule and wirte this code Sub Main() Dim frm1 As New Form1() frm1.Show() Application.Run() End Sub Public Sub Closer() Application.Exit() End Sub now go to the Start Up project : by rigth click on your project in solution explorer and select the StartModule to be the start up object "" Taht's all now you can close the frm1 (form1) by calling me.Close() Method And Close application alltogether by calling the Closer() sub it's Global Method that exist in our StartModule I hope it help bye Quote Gary Says: To be a good programmer, you must be good at debugging
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.