I'm having problems getting windows to close my app when the user shuts down
or logs off.

All I have in my project is a module and a form.

The module contains the following code:

Module modMain

Sub Main()

Dim frm As New Form1

frm.ShowDialog()

End Sub

End Module

The form contains no controls or code (other than auto generated stuff).

The start-up object is set to Sub Main.

When I try to log off or shutdown, the app closes but there is no log off or
shut down!

Any ideas, - this is driving me mad!

Regards

Nick

Re: Shutdown fails when app is running by hirf-spam-me-here

hirf-spam-me-here
Wed Feb 11 12:46:24 CST 2004

* "Nick Ma" <nickm@bhx.co.uk> scripsit:
> I'm having problems getting windows to close my app when the user shuts down
> or logs off.
>
> All I have in my project is a module and a form.
>
> The module contains the following code:
>
> Module modMain
>
> Sub Main()
>
> Dim frm As New Form1
>
> frm.ShowDialog()

Use 'Application.Run(New Form1())' instead of the code above.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Re: Shutdown fails when app is running by Nick

Nick
Thu Feb 12 03:41:56 CST 2004

Works a treat.

Many thanks.

Nick

"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:%237qMn9M8DHA.2028@TK2MSFTNGP10.phx.gbl...
> * "Nick Ma" <nickm@bhx.co.uk> scripsit:
> > I'm having problems getting windows to close my app when the user shuts
down
> > or logs off.
> >
> > All I have in my project is a module and a form.
> >
> > The module contains the following code:
> >
> > Module modMain
> >
> > Sub Main()
> >
> > Dim frm As New Form1
> >
> > frm.ShowDialog()
>
> Use 'Application.Run(New Form1())' instead of the code above.
>
> --
> Herfried K. Wagner [MVP]
> <http://www.mvps.org/dotnet>