The DropDown method is used to display the dropdown window. If the button is already dropped down (see IsDroppedDown), nothing further occurs. Otherwise, the DroppingDown event is invoked and if not cancelled, the dropdown window is displayed.
The control may also be dropped down by clicking on the dropdown button or via the DOWN arrow key when the control has focus.
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; } }
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