Hi,
i"m creating an application involving multiple forms i"ve successfully linked the forms but the problem is when
a new form(form2) is linked by a button control form1 is also running,so i placed the following code in the load event of form2 "form1.close()" this segment of code terminates the entire program when executed. how can i create an application with multiple forms but a single form will be displayed at the moment unless the users enters into a new form....

Hi,

Add another MainForm, And make it MDIForm by setting the property (ISMSI=True). Create Menus to show different forms. and In MenuClick, Show the Forms (In Modal)..

Regards
Veena

Or you can make sure you have your application setting set to shutdown the application only after all forms close. My guess is that it's set to form1 right now.

Another option is you can give-

form1.hide()

in the form load event of form2.

Then is closing event of form2 you can give-

me.Close()
form1.Close()
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.