473,405 Members | 2,349 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

I would like an Event to occurr 100% of the time when my app is closing

Hi Gang,
I can't seem to find an event for my form that'll occur when the user
presses Alt+F4. Can someone provide the name/location of such an event for
me?
Thanks in Advance,
Christian Blackburn
Nov 20 '05 #1
4 1008
"Christian Blackburn" <Christian@Damn@Sp**@Hotmail.com> schrieb
I can't seem to find an event for my form that'll occur when the
user presses Alt+F4. Can someone provide the name/location of such
an event for me?


If you set a Form as the startup object, the Closed event always fires.
If you specified a Sub Main as the start procedure, the end of the
application/main thread is at "End Sub" of Sub Main.

Sub Main
'...

Application.Run()
'---> here is the end <---
end sub
--
Armin

Nov 20 '05 #2
Hi Armin,
Thanks for trying to help, but I did try every legitimate and to me at least
obvious event for my form. And yes the form is my startup procedure. The
closed event does not fire when you exit if you press Alt+F4. Try it for
yourself. I'm using VB2003 and that may and or may not be part of the
problem.
Cheers,
Christian
"Armin Zingler" <az*******@freenet.de> wrote in message
news:Of****************@TK2MSFTNGP11.phx.gbl...
"Christian Blackburn" <Christian@Damn@Sp**@Hotmail.com> schrieb
I can't seem to find an event for my form that'll occur when the
user presses Alt+F4. Can someone provide the name/location of such
an event for me?


If you set a Form as the startup object, the Closed event always fires.
If you specified a Sub Main as the start procedure, the end of the
application/main thread is at "End Sub" of Sub Main.

Sub Main
'...

Application.Run()
'---> here is the end <---
end sub
--
Armin

Nov 20 '05 #3
"Christian Blackburn" <Christian@Damn@Sp**@Hotmail.com> schrieb
Hi Armin,
Thanks for trying to help, but I did try every legitimate and to me
at least obvious event for my form. And yes the form is my startup
procedure. The closed event does not fire when you exit if you press
Alt+F4. Try it for yourself. I'm using VB2003 and that may and or
may not be part of the problem.


It also fires using Alt+F4. Can you reproduce it in a new project?

Of course, you mustn't uses the "End" statement. ;-)
--
Armin

Nov 20 '05 #4
Hi Armin,
It would seem that you are correct. I'll have to look into why that might
be. The event seriously doesn't fire on my system with the project I'm
working on. However when I created a sample project with one line of code
inside of a Form_Closed event:
Msgbox "I'm closed!"
things did in fact work fine.
Cheers,
Christian
"Armin Zingler" <az*******@freenet.de> wrote in message
news:eH****************@tk2msftngp13.phx.gbl...
"Christian Blackburn" <Christian@Damn@Sp**@Hotmail.com> schrieb
Hi Armin,
Thanks for trying to help, but I did try every legitimate and to me
at least obvious event for my form. And yes the form is my startup
procedure. The closed event does not fire when you exit if you press
Alt+F4. Try it for yourself. I'm using VB2003 and that may and or
may not be part of the problem.


It also fires using Alt+F4. Can you reproduce it in a new project?

Of course, you mustn't uses the "End" statement. ;-)
--
Armin

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
3
by: ThunderMusic | last post by:
Hi, I'm trying to have a MSN Messenger like form/app closing behavior. When I click on the X button, I only want the form to disappear and when I double-click on the notify icon or right-click...
1
by: Chris Bruce | last post by:
In my application I need a way to distiguish between the following events: 1. When a user closes an MDI child window. 2. When the user closes the MDI parent window which subsequently closes the...
1
by: Chirag Malvi | last post by:
hello all, I am developing the web application using ASP.net and VS.2003 IDE. here is the situation which i want to implement. 1) User is browsing some webform. I want to trap this event....
5
by: Uma Muthu | last post by:
Hello Everyone, How can I capture the event of closing the IE browser from within an ASP.NET web application? TIA, Uma
5
by: Stan Sainte-Rose | last post by:
Hi, Which event is called when the user click on the close window icon (X) ? I want, when he clicks on this icon, to display a message before closing the form. If he replys by No, I don't want to...
5
by: esha | last post by:
When Form is invoked with myForm.Show what is the last event of the form object? I have some code in TextChanged events of many TextBoxes and other controls populated with data from datatable via...
4
by: Academic | last post by:
Does it make sense to put this If e.Cancel Then Exit Sub at the beginning of form closing events so if the user cancels the app's exiting in one Closing routine he will not be asked again by...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.