'Declaration Public Event ExpandedStateChanging As CancelEventHandler
public event CancelEventHandler ExpandedStateChanging
The event handler receives an argument of type CancelEventArgs containing data related to this event. The following CancelEventArgs properties provide information specific to this event.
Property | Description |
---|---|
Cancel |
Private Sub UltraExpandableGroupBox1_ExpandedStateChanging(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles UltraExpandableGroupBox1.ExpandedStateChanging ' If the control is in the process of expanding, then just return. If Not Me.UltraExpandableGroupBox1.Expanded Then Return End If ' If the input values of the UltraExpandableGroupBox's contained controls ' are invalid, prevent the control from collapsing. If Not Me.IsInputValid Then e.Cancel = True End If End Sub Private ReadOnly Property IsInputValid() As Boolean Get Dim isValid As Boolean = True ' Perform processing, such as attempting to update a database, ' to determine if the values in the controls in the ' UltraExpandableGroupBox are valid... Return isValid End Get End Property
private void ultraExpandableGroupBox1_ExpandedStateChanging(object sender, System.ComponentModel.CancelEventArgs e) { // If the control is in the process of expanding, then just return. if( ! this.ultraExpandableGroupBox1.Expanded ) return; // If the input values of the UltraExpandableGroupBox's contained controls // are invalid, prevent the control from collapsing. if( ! this.IsInputValid ) e.Cancel = true; } private bool IsInputValid { get { bool isValid = true; // Perform processing, such as attempting to update a database, // to determine if the values in the controls in the // UltraExpandableGroupBox are valid... return isValid; } }
Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2