Version

UltraDropDownButton Class

Represents a button control that can display a dropdown window.
Syntax
'Declaration
 
Public Class UltraDropDownButton 
   Inherits UltraButtonBase
   Implements Infragistics.Win.AppStyling.ISupportAppStyling, Infragistics.Win.IImageListProvider, Infragistics.Win.IUltraControl, Infragistics.Win.IUltraControlElement, Infragistics.Win.Touch.ISupportTouchMetrics, Infragistics.Win.UIAutomation.IProvideUIAutomation 
public class UltraDropDownButton : UltraButtonBase, Infragistics.Win.AppStyling.ISupportAppStyling, Infragistics.Win.IImageListProvider, Infragistics.Win.IUltraControl, Infragistics.Win.IUltraControlElement, Infragistics.Win.Touch.ISupportTouchMetrics, Infragistics.Win.UIAutomation.IProvideUIAutomation  
Remarks

The UltraDropDownButton is a button control that can display a dropdown window.

When the Style is set to SplitButton, the control displays 2 buttons areas. The main button area acts as a standard button and will invoke the System.Windows.Forms.Control.Click event when the button is released. An additional button with a dropdown arrow is displayed and can be used to display the dropdown window. When the Style is set to DropDownButtonOnly, only one button is displayed. When clicked, this button displays the dropdown window.

The PopupItem property is used to specify the object that will provide the dropdown window. This could be any class that implements the Infragistics.Win.IPopupItem interface including the UltraPopupControlContainer or any PopupToolBase from an UltraToolbarsManager including its PopupMenuTool, PopupColorPickerTool, or PopupControlContainer tool.

When the dropdown window is about to be displayed, the DroppingDown event is invoked and may be cancelled to prevent the dropdown from being displayed. If the dropdown window is displayed, the ClosedUp event will be invoked after the dropdown window has been closed.

Set the AcceptButton or CancelButton property of a Form to the button to allow the click event to be invoked using the ENTER or ESC keys respectively even if the button does not have focus.

When the form containing the button is displayed using the form's ShowDialog method, the System.Windows.Forms.DialogResult property of the button may be used to specify the return value of the ShowDialog method.

Note Even when the Style property is set to DropDownButtonOnly, the System.Windows.Forms.Control.Click event will still be invoked if it is the AcceptButton or CancelButton for the form and the ENTER or ESC key is pressed.

Example
The following sample demonstrates initializing the PopupItem property of the UltraDropDown button.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.Misc
Private Sub frmUltraDropDownButton_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    'The PopupItem property may be set to any object that implements the IPopupItem
    'interface. Currently that includes the UltraPopupControlContainer component 
    'and several tools from the UltraToolbarsManager include PopupMenuTool, 
    'PopupControlContainerTool, and PopupColorPickerTool
    '

    ' initialize the PopupItem to the object
    ' that will provide the dropdown window
    Me.ultraDropDownButton1.PopupItem = Me.ultraPopupControlContainer1

    'The following UltraToolbarsManager tools also implement
    'the IPopupItem interface and may be used to provide the 
    'dropdown window for an UltraDropDownButton control.
    '
    'Dim popupMenu As Infragistics.Win.UltraWinToolbars.PopupMenuTool
    'popupMenu = CType(Me.UltraToolbarsManager1.Tools("PopupMenuTool1"), Infragistics.Win.UltraWinToolbars.PopupMenuTool)
    'Me.ultraDropDownButton1.PopupItem = popupMenu

    'Dim popupContainer As Infragistics.Win.UltraWinToolbars.PopupControlContainerTool
    'popupContainer = CType(Me.UltraToolbarsManager1.Tools("PopupControlContainerTool1"), Infragistics.Win.UltraWinToolbars.PopupControlContainerTool)
    'Me.ultraDropDownButton1.PopupItem = popupContainer

    'Dim popupColor As Infragistics.Win.UltraWinToolbars.PopupColorPickerTool
    'popupColor = CType(Me.UltraToolbarsManager1.Tools("PopupColorPickerTool1"), Infragistics.Win.UltraWinToolbars.PopupColorPickerTool)
    'Me.ultraDropDownButton1.PopupItem = popupColor
End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.Misc;

private void frmUltraDropDownButton_Load(object sender, System.EventArgs e)
{
	//The PopupItem property may be set to any object that implements the IPopupItem
	//interface. Currently that includes the UltraPopupControlContainer component 
	//and several tools from the UltraToolbarsManager include PopupMenuTool, 
	//PopupControlContainerTool, and PopupColorPickerTool
	//

	// initialize the PopupItem to the object
	// that will provide the dropdown window
	this.ultraDropDownButton1.PopupItem = this.ultraPopupControlContainer1;

	//The following UltraToolbarsManager tools also implement
	//the IPopupItem interface and may be used to provide the 
	//dropdown window for an UltraDropDownButton control.
	//
	//Infragistics.Win.UltraWinToolbars.PopupMenuTool popupMenu;
	//popupMenu = this.UltraToolbarsManager1.Tools["PopupMenuTool1"] as Infragistics.Win.UltraWinToolbars.PopupMenuTool;
	//this.ultraDropDownButton1.PopupItem = popupMenu;
	//
	//Infragistics.Win.UltraWinToolbars.PopupControlContainerTool popupContainer;
	//popupContainer = this.UltraToolbarsManager1.Tools["PopupControlContainerTool1"] as Infragistics.Win.UltraWinToolbars.PopupControlContainerTool;
	//this.ultraDropDownButton1.PopupItem = popupContainer;
	//
	//Infragistics.Win.UltraWinToolbars.PopupColorPickerTool popupColor;
	//popupColor = this.UltraToolbarsManager1.Tools["PopupColorPickerTool1"] as Infragistics.Win.UltraWinToolbars.PopupColorPickerTool;
	//this.ultraDropDownButton1.PopupItem = popupColor;
}
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