UI Automation Support for the ToolTip Control Type

This topic provides information about UI Automation support for the ToolTip control type. In UI Automation, a control type is a set of conditions that a control must meet in order to use the ControlTypeProperty property. The conditions include specific guidelines for UI Automation tree structure, UI Automation property values and control patterns.

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, whether Windows Presentation Foundation (WPF), Win32, or

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 tooltip controls and describes what can be contained in each view. For more information on the UI Automation tree, see UI Automation Tree Overview.

Control View Content View
  • ToolTip

  • Text (0 or 1)

  • Image (0 or 1)

  • 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 HelpTextProperty on the UI Automation element that the tooltip is referring to.

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

Required UI Automation Properties

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


UI Automation Property Value Notes

AutomationIdProperty

See notes.

The value of this property needs to be unique across all controls in an application.

BoundingRectangleProperty

See notes.

The outermost rectangle that contains the whole control.

ClickablePointProperty

See notes.

The clickable point should be the part of the tooltip that will dismiss the control. Some tooltips do not have this ability and will not have a clickable point.

IsKeyboardFocusableProperty

See notes.

If the control can receive keyboard focus, it must support this property.

NameProperty

See notes.

The name of the Tooltip control is the text that is displayed within the tooltip.

LabeledByProperty

Null

Tooltip controls are always self-labeled by their contents.

ControlTypeProperty

ToolTip

This value is the same for all UI frameworks.

LocalizedControlTypeProperty

"ToolTip"

Localized string corresponding to the ToolTip control type.

IsContentElementProperty

Depends

If the Tooltip control can receive keyboard focus, it must be in the Content View of the tree. If it is text only, then it is available as the HelpTextProperty from the control that raised it.

IsControlElementProperty

True

The tooltip control must always be a control.

HelpTextProperty

Null

The HelpText property will always be null for a tooltip control.

Required UI Automation 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/Pattern Property Support/Value Notes

IWindowProvider

Depends

Tooltips that can be closed by clicking a UI item must support WindowPattern so that they can closed automatically.

ITextProvider

Depends

Not all UI Automation providers will be able to expose TextPattern for tooltip controls.

Required UI Automation Events

Tooltip controls must raise the ToolTipOpenedEvent 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 required to be supported by all tooltip controls. For more information about events, see UI Automation Events Overview.


UI Automation Event Support Notes

TextSelectionChangedEvent

Depends

None

TextChangedEvent

Depends

None

WindowClosedEvent

Depends

None

WindowOpenedEvent

Depends

None

TooltipOpenedEvent

Required

None

TooltipClosedEvent

Required

None

BoundingRectangleProperty property-changed event.

Required

None

IsOffscreenProperty property-changed event.

Required

None

IsEnabledProperty property-changed event.

Required

None

NameProperty property-changed event.

Required

None

WindowVisualStateProperty property-changed event.

Depends

None

AutomationFocusChangedEvent

Required

None

StructureChangedEvent

Required

None

See Also

Reference

ToolTip

Concepts

UI Automation Control Types Overview
UI Automation Overview