Detecting form is closing from custom control

mtlmonk

New member
Joined
Jun 12, 2008
Messages
4
Programming Experience
3-5
Hello,

I have created a custom control derived from the standard ComboBox class.

In there, on the OnLeave trigger, I need to launch the OnSelectionChangeCommitted trigger that is on the form code.

The problem is that I need to find out if it was a Form closing that triggered the OnLeave of the form. Therefore, not calling the OnSelectionChangeCommitted trigger.

I've tried finding a property that will indicate the form is closing but could not find one.

Here is the code of the custom control OnLeave trigger:

VB.NET:
Expand Collapse Copy
Protected Overrides Sub OnLeave(ByVal e As EventArgs)
IF (.......the form is closing)
  EXIT THE SUB
ELSE
  Me.OnSelectionChangeComitted(e)
End Sub
 
Back
Top