ComboBox Control Type
This topic provides information about Microsoft UI Automation support for the ComboBox control type.
A combo box is a list box combined with a static control or an edit control that displays the currently selected item in the list box portion of the combo box. The list box portion of the control is displayed at all times or only appears when the user selects the drop-down arrow (which is a push button) next to the control. If the selection field is an edit control, the user can enter information that is not in the list; otherwise, the user can only select items in the list.
The following sections define the required UI Automation tree structure, properties, control patterns, and events for the ComboBox control type. The UI Automation requirements apply to all combo box controls where the UI framework/platform integrates UI Automation support for control types and control patterns.
This topic contains the following sections.
The following table depicts a typical control and content view of the UI Automation tree that pertains to combo box controls and describes what can be contained in each view. For more information about the UI Automation tree, see UI Automation Tree Overview.
|Control View||Content View|
The edit control in the control view of the combo box is necessary only if the combo box can be edited to take any input, as is the case of the combo box in the Run dialog box.
The following table lists the UI Automation properties whose value or definition is especially relevant to the ComboBox control type. For more information about UI Automation properties, see Retrieving Properties from UI Automation Elements.
|UI Automation Property||Value||Notes|
|UIA_AutomationIdPropertyId||See notes.||The value of this property must be unique among all peer elements in the raw view of the UI Automation tree.|
|UIA_BoundingRectanglePropertyId||See notes.||The outermost rectangle that contains the whole control.|
|UIA_ClickablePointPropertyId||See notes.||Supported if there is a bounding rectangle. If not every point within the bounding rectangle is clickable, and the element performs specialized hit testing, override and provide a clickable point.|
|UIA_HelpTextPropertyId||See notes.||The help text for combo box controls should explain why the user is being asked choose an option from the combo box. The text is similar to information presented through a tooltip. For example, "Select an item to set the display resolution of your monitor."|
|UIA_IsContentElementPropertyId||TRUE||Combo box controls are always included in the content view of the UI Automation tree.|
|UIA_IsControlElementPropertyId||TRUE||Combo box controls are always included in the control view of the UI Automation tree.|
|UIA_IsKeyboardFocusablePropertyId||TRUE||Combo box controls can receive keyboard focus; however, when a UI Automation client sets focus to a combo box, any item in the combo box subtree can receive the focus.|
|UIA_LabeledByPropertyId||See notes.||Combo box controls typically have a static text label that this property references.|
|UIA_LocalizedControlTypePropertyId||See notes.||Localized string corresponding to the ComboBox control type. The default value is "combo box" for en-US or English (United States).|
|UIA_NamePropertyId||See notes.||The name of the combo box control is typically generated from a static text label. If there is not a static text label, you must assign a value for the Name property. The Name property should never contain the current contents of the combo box or change when the contents of the combo box change.|
The following table lists the UI Automation control patterns required to be supported by all combo box controls. For more information on control patterns, see UI Automation Control Patterns Overview.
|IExpandCollapseProvider||Required||The ExpandCollapse control pattern must be supported because a combo box control must always contain a drop-down button.|
|ISelectionProvider||Depends||Displays the current selection in the combo box. Support for the Selection control pattern is delegated to the list box beneath the combo box, but may not always be feasible.|
|IValueProvider||Depends||If the combo box can take arbitrary text values, the Value control pattern must be supported. This pattern enables the string contents of the combo box to be set programmatically. If the Value control pattern is not supported, the user must select from the list items within the subtree of the combo box.|
|IScrollProvider||Never||The Scroll control pattern is never supported directly on a combo box. It is supported if a list box contained within a combo box can scroll, and only when the list box is visible on the screen.|
The following table lists the UI Automation events that combo box controls are required to support. For more information on events, see UI Automation Events Overview.
|UI Automation Event||Notes|
|UIA_BoundingRectanglePropertyId property-changed event.|
|UIA_IsEnabledPropertyId property-changed event.||If the control supports the IsEnabled property, it must support this event.|
|UIA_IsOffscreenPropertyId property-changed event.||If the control supports the IsOffscreen property, it must support this event.|
|UIA_ExpandCollapseExpandCollapseStatePropertyId property-changed event.|
|UIA_ValueValuePropertyId property-changed event.||If the control supports the Value control pattern, it must support this event.|