Home All Groups Group Topic Archive Search About
Author
24 May 2006 7:27 PM
vul
I start the application with Application.Run(New MDIMain) in Sub Main.
MDIMain is the mdi form which loads and then calls Login form.
I'm using Application.Exit to terminate my VB 2005 application on Login
screen if user clicks on Cancel button.
When I do this I get a sound as MessageBox produces. I do not see any
messages, but VB environment works abnormally after that. It doesn't switch
modules until I minimize it and maximize again or close solution and open
again. I suspect that there is a problem with Application.Exit.
What is a good approach to terminate the application?

Thank you
Al

Author
24 May 2006 9:14 PM
Herfried K. Wagner [MVP]
"vul" <a**@optonline.net> schrieb:
>I start the application with Application.Run(New MDIMain) in Sub Main.
>MDIMain is the mdi form which loads and then calls Login form.
> I'm using Application.Exit to terminate my VB 2005 application on Login
> screen if user clicks on Cancel button.
> When I do this I get a sound as MessageBox produces. I do not see any
> messages, but VB environment works abnormally after that. It doesn't
> switch modules until I minimize it and maximize again or close solution
> and open again. I suspect that there is a problem with Application.Exit.
> What is a good approach to terminate the application?

Try closing the application's main form by calling its 'Close' method.

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
24 May 2006 9:48 PM
vul
Thank you.
Unfortunately everything is the same with using MDIMain.Close

Al

Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:edpBDc3fGHA.3572@TK2MSFTNGP04.phx.gbl...
> "vul" <a**@optonline.net> schrieb:
>>I start the application with Application.Run(New MDIMain) in Sub Main.
>>MDIMain is the mdi form which loads and then calls Login form.
>> I'm using Application.Exit to terminate my VB 2005 application on Login
>> screen if user clicks on Cancel button.
>> When I do this I get a sound as MessageBox produces. I do not see any
>> messages, but VB environment works abnormally after that. It doesn't
>> switch modules until I minimize it and maximize again or close solution
>> and open again. I suspect that there is a problem with Application.Exit.
>> What is a good approach to terminate the application?
>
> Try closing the application's main form by calling its 'Close' method.
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://classicvb.org/petition/>
Author
24 May 2006 10:55 PM
vul
I added Me.Close in Login form before Application.Exit.
Now there is no messagebox like sound and no problem with VS environment
after stopping the application, but there is a delay for about 5-6 seconds
in VS environment. The application disappears from the screen without any
delay, but the button stop in VS environment remains enable for those 5-6
seconds. When I run compiled exe I do not see any problem (maybe it's
hidden)

Thank you
Al
Show quoteHide quote
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:edpBDc3fGHA.3572@TK2MSFTNGP04.phx.gbl...
> "vul" <a**@optonline.net> schrieb:
>>I start the application with Application.Run(New MDIMain) in Sub Main.
>>MDIMain is the mdi form which loads and then calls Login form.
>> I'm using Application.Exit to terminate my VB 2005 application on Login
>> screen if user clicks on Cancel button.
>> When I do this I get a sound as MessageBox produces. I do not see any
>> messages, but VB environment works abnormally after that. It doesn't
>> switch modules until I minimize it and maximize again or close solution
>> and open again. I suspect that there is a problem with Application.Exit.
>> What is a good approach to terminate the application?
>
> Try closing the application's main form by calling its 'Close' method.
>
> --
> M S   Herfried K. Wagner
> M V P  <URL:http://dotnet.mvps.org/>
> V B   <URL:http://classicvb.org/petition/>
Author
25 May 2006 3:28 PM
Mythran
Show quote Hide quote
"vul" <a**@optonline.net> wrote in message
news:uebf1U4fGHA.452@TK2MSFTNGP02.phx.gbl...
>I added Me.Close in Login form before Application.Exit.
> Now there is no messagebox like sound and no problem with VS environment
> after stopping the application, but there is a delay for about 5-6 seconds
> in VS environment. The application disappears from the screen without any
> delay, but the button stop in VS environment remains enable for those 5-6
> seconds. When I run compiled exe I do not see any problem (maybe it's
> hidden)
>
> Thank you
> Al
> "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
> news:edpBDc3fGHA.3572@TK2MSFTNGP04.phx.gbl...
>> "vul" <a**@optonline.net> schrieb:
>>>I start the application with Application.Run(New MDIMain) in Sub Main.
>>>MDIMain is the mdi form which loads and then calls Login form.
>>> I'm using Application.Exit to terminate my VB 2005 application on Login
>>> screen if user clicks on Cancel button.
>>> When I do this I get a sound as MessageBox produces. I do not see any
>>> messages, but VB environment works abnormally after that. It doesn't
>>> switch modules until I minimize it and maximize again or close solution
>>> and open again. I suspect that there is a problem with Application.Exit.
>>> What is a good approach to terminate the application?
>>
>> Try closing the application's main form by calling its 'Close' method.
>>
>> --
>> M S   Herfried K. Wagner
>> M V P  <URL:http://dotnet.mvps.org/>
>> V B   <URL:http://classicvb.org/petition/>
>
>

Are you connected to a database or something and haven't closed/disposed the
connection yet?

Mythran