Re: Sub Main

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: David Schwartz (dave_at_hr-symphony.com)
Date: 04/30/04


Date: Fri, 30 Apr 2004 11:53:04 -0400

If form f then shows another form g and f is closed, will the app remain
open?
Thanks.

"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:c6tq2m$fpm6t$2@ID-208219.news.uni-berlin.de...
> * "David Schwartz" <dave@hr-symphony.com> scripsit:
> > In my Windows Forms app, I tried using a Sub Main as my startup object.
The
> > problem I found is that as soon as the End Sub is reached, the app
> > terminates (even if I showed a form during the sub). Has anyone else
seen
> > this? How can this be avoided, other than by using a form as the
startup
> > object?
>
> For Windows Forms applications:
>
> \\\
> Public Class AppMain
> Public Shared Sub Main()
> Dim f As New MainForm()
> Application.Run(f)
> End Sub
> End Class
> ///
>
> --
> Herfried K. Wagner [MVP]
> <URL:http://dotnet.mvps.org/>



Relevant Pages

  • Overriding the "X" control and using WndProc
    ... I have an application that should run in the system tray while open. ... the "X" button is pushed on the form...but without closing the app. ... > Private Sub frmMain_Closing(ByVal sender As Object, ... and windows can't shutdown without closing my app first. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Win32 talking to *nix question
    ... If you can open a socket in delphi, you should be able to get this to work ... sub time_stamp { ... > I have a small Delphi app that runs under Windows. ...
    (borland.public.delphi.non-technical)
  • AppDomain.UnhandledException in Windows Forms and Windows Service
    ... Windows Forms app and also in a Windows Service. ... Protected Overrides Sub OnStartAs String) ... Where UnhandledExceptionHandler is just a sub with some logging ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Sub Main
    ... > In my Windows Forms app, I tried using a Sub Main as my startup object. ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Sub Main
    ... >> In my Windows Forms app, I tried using a Sub Main as my startup ... The problem I found is that as soon as the End Sub is ... > Public Class AppMain ...
    (microsoft.public.dotnet.languages.vb)