
Sub Main(): keep app open after showing form?
Use Application.Run() instead of Application.Run(frm). This will set up a
message loop independent of your forms.
Just remember that you will have to call Application.Exit() after closing
the last form, or else the application will continue to run with no visible
interface.
-- David Shannon
Quote:
> This seems to work until I close the first form (frmChooseDeal) and load
> another... anyway to get around that?
> - Noah
> > > I have this Sub Main()
> > > Sub Main()
> > > Dim frm As New frmChooseDeal()
> > > frm.Show()
> > > *** the problem is, the application will close right here!
> > > End Sub
> > > ** the only way i can figure out how to keep the app open is by
> > > doing this:
> > > Dim f As Form
> > > Try
> > > While f.ActiveForm.GetType.ToString() <> ""
> > > Application.DoEvents()
> > > End While
> > > Catch e As SystemException
> > > 'let Main() close itself
> > > End Try
> > > ** although i think this is very inefficient. any other ideas?
> > > - Noah
> > Sub Main()
> > Dim frm As New frmChooseDeal()
> > frm.Show()
> > Application.Run(frm)
> > End Sub
> > AFAIK, you can even leave out frm.Show
> > Armin