Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Multiple Dialogs, but closing one closes them all

Status
Not open for further replies.

RichardF

Programmer
Oct 9, 2000
239
0
0
GB
Hi,

My app may open several instances of the same form. However closing the first form ( this is the one with the [STAThread], Application.Run etc ) then all instances of that form close at the same time.

Is there a way round this ?

Thanks
Rich.
 
Application.Run(form) is the process that keeps your application alive.

create a hidden form which opens your other instances and only shuts down the application after all instances have been closed.

either that or be a tidy bod and use an mdi container.


mr s. <;)

 
Umm.... try moving the Application.Run() to a separate class which has its own ApplicationContext. You can then launch multiple forms from that class and the class will get destroyed only when all forms are closed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top