By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,949 Members | 950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,949 IT Pros & Developers. It's quick & easy.

closing form / X Button

jamesd0142
100+
P: 469
hi, is it possible to run a code when the form is closed.

What i mean is... when the user clicks the x on the top right to close the form, can i run code before the form closes?

i have done something simular before... when the user clicks the x button a dialog box appears says "are you sure"... "yes" or "No"

But i forgot how i did it.

please help

Thanks James
Sep 21 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 5K+
P: 8,434
The details will vary a bit between versions of VB, but you probably want to place your code in the Unload or QueryUnload event procedures. One important difference is that in the QueryUnload, you can refuse to let the form be unloaded, by setting the Cancel parameter to True.
Sep 22 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.