Visual Basic Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingVisual Basic Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old January 27th, 2006, 06:12 AM
explosive_tom explosive_tom is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 2 explosive_tom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 55 sec
Reputation Power: 0
Executing Code on Visual Basic Exit

Hi,

I am writing a program in visual basic 6.

I need to be able to execute some code whenever the user closes the program. (Clicks on the 'x' in the top right hand corner or press' alt-f4 etc...

How do I go about capturing that event?

Thanks

Reply With Quote
  #2  
Old January 27th, 2006, 10:04 AM
Darius Darius is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 108 Darius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 16 m 54 sec
Reputation Power: 5
Quote:
Originally Posted by explosive_tom
Hi,

I am writing a program in visual basic 6.

I need to be able to execute some code whenever the user closes the program. (Clicks on the 'x' in the top right hand corner or press' alt-f4 etc...

How do I go about capturing that event?

Thanks


Private Sub Form_Terminate()
msgbox "Terminate"
End Sub

or

Private Sub Form_Unload()
msgbox "Unload"
End Sub

I am not sure

Reply With Quote
  #3  
Old January 27th, 2006, 02:49 PM
explosive_tom explosive_tom is offline
Registered User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Jan 2006
Posts: 2 explosive_tom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 55 sec
Reputation Power: 0
Thanks. I think Form_Terminate() should do the trick

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingVisual Basic Programming > Executing Code on Visual Basic Exit


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
Stay green...Green IT