Improved Close Event

RandomCoder

Well-Known Member
Licensed User
Is it possible to add a value within the Form Closing Event that shows whether the Close Event was triggered by a Cick or a Windows command (such as shutting down).
This would allow us to selectively use the CancelClose property.

Thanks,
RandomCoder
 

Cableguy

Expert
Licensed User
I think that can be already done by using the sender keyword...
Checking if the close event was triggered by a known control, wich can be listed with the controls array...
 

Erel

Administrator
Staff member
Licensed User
The Sender keyword will not help here.
It will always have the value of the closing form
Sender can be helpful when you have one sub that handles events of several controls.
 

RandomCoder

Well-Known Member
Licensed User
But is it possible to distinguish if a click event or a windows message was responsible for the form closing?

PS I'm attempting to use DZT's Event magic to work my own temporary solution (first got to cook tea for the ankle biters, but will try again later following Agraham's advice)

Regards,
RandomCoder.
 

Erel

Administrator
Staff member
Licensed User
But is it possible to distinguish if a click event or a windows message was responsible for the form closing?
I don't think that it is possible with managed code.
 
Top