main() in module sub

  • Thread starter news.microsoft.com
  • Start date
N

news.microsoft.com

Hi,

I have my start point set to the main() sub in a module.

In main() I then show my form using the show.dialog method.

Problem I am having is that when an error fires anywhere it the app it falls
back into the main(), and then goes on with code after the showdialog line,
which ends my app.

I know I should be managing my errors better, but I was wondering if the
showdialog is the best way
 
T

Tom Dacon

Use Application.Run(frm) instead of frm.ShowDialog(). For example:


Public Shared Sub Main()
Application.Run(New TestForm())
End Sub

Tom Dacon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top