Version

DroppingDown Event

Invoked before the dropdown is displayed
Syntax
'Declaration
 
Public Event DroppingDown As CancelEventHandler
public event CancelEventHandler DroppingDown
Event Data

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.

PropertyDescription
Cancel  
Remarks

The DroppingDown event is raised when the dropdown window (specified using the PopupItem property) is about to be displayed. If the event is cancelled or there is nothing to dropdown, the dropdown will not be displayed.

Example
The following sample demonstrates catching the DroppingDown event of the UltraDropDownButton

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.Misc

Private cancelDropDown As Boolean = False

Private Sub ultraDropDownButton1_DroppingDown(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles ultraDropDownButton1.DroppingDown
    ' the DroppingDown event is raised when the dropdown
    ' button is pressed, dropped down using the down arrow key, 
    ' or when invoked via code (using the DropDown method)

    ' the popupitem can be changed at this point or
    ' the dropdown action can be cancelled by setting
    ' the Cancel parameter to true
    If cancelDropDown Then
        e.Cancel = True
    End If

    System.Diagnostics.Debug.WriteLine("DroppingDown")
End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.Misc;

private bool cancelDropDown = false;

private void ultraDropDownButton1_DroppingDown(object sender, System.ComponentModel.CancelEventArgs e)
{
	// the DroppingDown event is raised when the dropdown
	// button is pressed, dropped down using the down arrow key, 
	// or when invoked via code (using the DropDown method)

	// the popupitem can be changed at this point or
	// the dropdown action can be cancelled by setting
	// the Cancel parameter to true
	if (cancelDropDown)
		e.Cancel = true;

	System.Diagnostics.Debug.WriteLine("DroppingDown");
}
Requirements

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

See Also