tags:

views:

30

answers:

1

When I try to show a form, I have to use ShowDialog instead of Show. (This is causing problems later in my code.) When I use show, the form pops up for a second and then the program closes. (VB.Net 2003)

+1  A: 

Use Application.Run() after showing your form so the application can continue working.

Or use Application.Run(yourForm) which will show your form and keep the application running until the yourForm closes.

Pierre-Alain Vigeant
After days of searching the web and finding answers that don't work,this works - and it's so simple! Thank you!
Min
Be aware that if you call `Application.Run()`, you will have to explicitly stop the application by calling `Application.Exit()` when your form closes, like in the `Form_Closed` event.
Pierre-Alain Vigeant