Version

CloseUp Method

Used to close up the dropdown window.
Syntax
'Declaration
 
Public Overridable Sub CloseUp() 
public virtual void CloseUp()
Remarks

The CloseUp method is used to close the dropdown window. Once the dropdown window has been closed, the ClosedUp event will be invoked.

Example
The following example shows how to use the KeyDown event of the UltraDropDownButton to manipulate its state.

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

Private Sub UltraDropDownButton2_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles UltraDropDownButton2.KeyDown
    ' Assuming the dropdown button has focus, it will receive
    ' key events so we can programatically drop it down or
    ' close it up.
    '

    Dim button As UltraDropDownButton = CType(sender, UltraDropDownButton)

    If e.KeyCode = Keys.Add AndAlso Not Button.IsDroppedDown Then
        e.Handled = True
        Button.DropDown()
    ElseIf e.KeyCode = Keys.Subtract AndAlso Button.IsDroppedDown Then
        e.Handled = True
        Button.CloseUp()
    ElseIf e.KeyCode = Keys.Space AndAlso Button.IsDroppedDown Then
        ' the space key can be used to cause the button
        ' Click event to fire but we can prevent that
        ' by marking it as handled
        e.Handled = True
    End If
End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.Misc;

private void ultraDropDownButton2_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
	// Assuming the dropdown button has focus, it will receive
	// key events so we can programatically drop it down or
	// close it up.
	//

	UltraDropDownButton button = sender as UltraDropDownButton;

	if (e.KeyCode == Keys.Add && !button.IsDroppedDown)
	{
		e.Handled = true;
		button.DropDown();
	}
	else if (e.KeyCode == Keys.Subtract && button.IsDroppedDown)
	{
		e.Handled = true;
		button.CloseUp();
	}
	else if (e.KeyCode == Keys.Space && button.IsDroppedDown)
	{
		// the space key can be used to cause the button
		// Click event to fire but we can prevent that
		// by marking it as handled
		e.Handled = true;
	}
}
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