show form2 ........
-
Hi Guru's, How can i achieve this...............:confused: There is a button on form1. On button clicking need to show form2 and close the form1(not to hide the form1) Regards, Ritesh
-
Hi Guru's, How can i achieve this...............:confused: There is a button on form1. On button clicking need to show form2 and close the form1(not to hide the form1) Regards, Ritesh
Well, the short answer is
form2.Show()
Me.Close()However, in reality it's not quite that simple. When you show your first form
with Application.Run(New Form1())
, the lifetime of the application is tied to the lifetime of your form. There's an article[^] by Marc Clifton on this site that explains how to switch top-level forms using a custom application context. Another approach is to start the application with an object that knows how to launch and close the forms in your application. To start with, it would show the initial "view" of your application (Form1) and, upon request, switch to a different "view", which could be closing form1 and opening form2 or opening forms 2 or three and closing form1 conditionally or whatever. The second approach is infinitely more flexible, but it also requires more work to implement. Charlie if(!curlies){ return; } -
Hi Guru's, How can i achieve this...............:confused: There is a button on form1. On button clicking need to show form2 and close the form1(not to hide the form1) Regards, Ritesh