Share via


UI Automation Support for the ToolTip Control Type

This topic provides information about Microsoft UI Automation support for the ToolTip control type. Tool tip 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 tool tip controls, whether Microsoft Windows Presentation Foundation (WPF), Microsoft Win32, or Windows Forms.

This topic contains the following sections.

  • Required UI Automation Tree Structure
  • Required UI Automation Properties
  • Required UI Automation Control Patterns
  • Required UI Automation Events
  • Related Topics

Required UI Automation Tree Structure

The following table depicts the control view and the content view of the UI Automation tree that pertains to tool tip 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

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

Tool tips 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 tool tips.

Required UI Automation Properties

The following table lists the UI Automation properties whose value or definition is especially relevant to tool tip controls. For more information about UI Automation properties, see UI Automation Properties for Clients.

UI Automation Property Value Notes
UIA_AutomationIdPropertyId See notes. The value of this property needs to be unique across all controls in an application.
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 tool tip that dismisses the control. Some tool tips do not have this ability and will not have a clickable point.
UIA_ControlTypePropertyId ToolTip This value is the same for all UI frameworks.
UIA_IsContentElementPropertyId Depends If the tool tip 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 IUIAutomationElement::CachedHelpText) property from the control that raised it.
UIA_IsControlElementPropertyId True The tool tip 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 Tool tip controls are always self-labeled by their contents.
UIA_LocalizedControlTypePropertyId See notes. Localized string corresponding to the ToolTip control type. The default value is "tool tip" for en-US or English (United States).
UIA_NamePropertyId See notes. The name of the tool tip control is the text that is displayed within the tool tip.

Required UI Automation Control Patterns

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

Control Pattern/Pattern Property Support/Value Notes
ITextProvider Depends For better accessibility, a tool tip 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 Tool tips that can be closed by clicking a UI item must support the Window control pattern so that they can closed automatically.

Required UI Automation Events

Tool tip 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 tool tip itself.

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

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