|
-
May 18th, 2005, 09:27 AM
#1
Thread Starter
Lively Member
-
May 18th, 2005, 09:32 AM
#2
Re: Close() and Closing()
Form_Closing() is where you should put the code to validate if yes or no the form will be close. by setting the e parameter
it append just before de form is close.
In the Form_Close()
The form is close so this is the place you should reset value or else ...
-
May 18th, 2005, 09:35 AM
#3
Re: Close() and Closing()
Form_Close is an instruction, a method indicating the form should be closed now.
Form_Closing is a happening, an event which is executed AS the form is closing.
Theoretically I guess both should be valid in disposing objects, but out of habit I usually use the Close() method.
MSDN seems to have a similar description for both:
When a form is closed, all resources created within the object are closed and the form is disposed. You can prevent the closing of a form at run time by handling the Closing event and setting the Cancel property of the CancelEventArgs passed as a parameter to your event-handling method. If the form you are closing is the startup form of your application, your application ends.
The Closing event occurs as the form is being closed. When a form is closed, all resources created within the object are released and the form is disposed. If you cancel this event, the form remains opened. To cancel the closure of a form, set the Cancel property of the CancelEventArgs passed to your event handler to true.
-
May 18th, 2005, 09:45 AM
#4
Thread Starter
Lively Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|