ToolTip Control Type

This topic provides information about Microsoft UI Automation support for the ToolTip control type. Tooltip controls are pop-up windows that contain text.

The following sections define the required UI Automation tree structure, properties, control patterns, and events for the ToolTip control type. The UI Automation requirements apply to all tooltip controls where the UI framework/platform integrates UI Automation support for control types and control patterns.

This topic contains the following sections.

Typical Tree Structure

The following table depicts a typical control and content view of the UI Automation tree that pertains to tooltip 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
  • ToolTip
    • Text (0 or more)
    • Image (0 or more)
  • ToolTip

 

Tooltip controls appear only in the content view of the UI Automation tree if they can receive keyboard focus. Otherwise, all of the tooltip's information is available from the IUIAutomationElement::CurrentHelpText (or CachedHelpText) property on the element that the tooltip is referring to.

Tooltips should appear beneath the control to which their information is referring. Clients must listen for the UIA_ToolTipOpenedEventId to ensure that they consistently obtain information contained in tooltips.

Relevant Properties

The following table lists the UI Automation properties whose value or definition is especially relevant to the ToolTip 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. The clickable point should be the part of the tooltip that dismisses the control. Some tooltips do not have this ability and will not have a clickable point.
UIA_ControlTypePropertyId ToolTip
UIA_IsContentElementPropertyId Depends If the tooltip control can receive keyboard focus, it must appear in the content view of the tree. If it is text only, it is available as the IUIAutomationElement::CurrentHelpText (or CachedHelpText) property from the control that raised it.
UIA_IsControlElementPropertyId True The tooltip control is always included in the control view of the UI Automation tree.
UIA_IsKeyboardFocusablePropertyId See notes. If the control can receive keyboard focus, it must support this property.
UIA_LabeledByPropertyId NULL Tooltip controls are always self-labeled by their contents.
UIA_LocalizedControlTypePropertyId See notes. Localized string corresponding to the ToolTip control type. The default value is "tooltip" for en-US or English (United States).
UIA_NamePropertyId See notes. The name of the tooltip control is the text that is displayed within the tooltip.

 

Required Control Patterns

The following table lists the UI Automation control patterns required to be supported by tooltip controls. For more information on control patterns, see UI Automation Control Patterns Overview.

Control Pattern Support Notes
ITextProvider Depends For better accessibility, a tooltip control can support the Text control pattern, although it is not required. The Text control pattern is useful when the text has rich style and attributes (for example, color, bold, and italics).
IWindowProvider Depends Tooltips that can be closed by clicking a UI item must support the Window control pattern so that they can closed automatically.

 

Required Events

Tooltip controls must raise the UIA_ToolTipOpenedEventId event when they appear on the screen. The event will include a reference to the UI Automation element of the tooltip itself.

The following table lists the UI Automation events that tooltip controls are required to support. For more information on events, see UI Automation Events Overview.

UI Automation Event Notes
UIA_AutomationFocusChangedEventId
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_NamePropertyId property-changed event.
UIA_Text_TextChangedEventId If the control supports the Text control pattern, it must support this event.
UIA_ToolTipClosedEventId
UIA_ToolTipOpenedEventId
UIA_StructureChangedEventId
UIA_Window_WindowClosedEventId If the control supports the Window control pattern, it must support this event.
UIA_Window_WindowOpenedEventId If the control supports the Window control pattern, it must support this event.
UIA_WindowWindowVisualStatePropertyId property-changed event. If the control supports the Window control pattern, it must support this event.

 

Conceptual

UI Automation Control Types Overview

UI Automation Overview