UI Automation Support for the ToolTip Control Type

 
System_CAPS_ICON_note.jpg Note

This documentation is intended for .NET Framework developers who want to use the managed UI Automation classes defined in the System.Windows.Automation namespace. For the latest information about UI Automation, see Windows Automation API: UI Automation.

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.

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

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 on the UI Automation tree, see UI Automation Tree Overview.

Control ViewContent 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 HelpTextProperty on the UI Automation element that the tool tip is referring to.

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

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 PropertyValueNotes
AutomationIdPropertySee notes.The value of this property needs to be unique across all controls in an application.
BoundingRectanglePropertySee notes.The outermost rectangle that contains the whole control.
ClickablePointPropertySee notes.The clickable point should be the part of the tool tip that will dismiss the control. Some tool tips do not have this ability and will not have a clickable point.
IsKeyboardFocusablePropertySee notes.If the control can receive keyboard focus, it must support this property.
NamePropertySee notes.The name of the tool tip control is the text that is displayed within the tool tip.
LabeledByPropertyNullTool tip controls are always self-labeled by their contents.
ControlTypePropertyToolTipThis value is the same for all UI frameworks.
LocalizedControlTypeProperty"tool tip"Localized string corresponding to the ToolTip control type.
IsContentElementPropertyDependsIf the tool tip 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.
IsControlElementPropertyTrueThe tool tip control must always be a control.

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 PatternSupportNotes
IWindowProviderDependsTool tips that can be closed by clicking a UI item must support WindowPattern so that they can closed automatically.
ITextProviderDependsFor 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).

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

UI Automation EventSupportNotes
TextSelectionChangedEventDependsNone
TextChangedEventDependsNone
WindowClosedEventDependsNone
WindowOpenedEventDependsNone
ToolTipOpenedEventRequiredNone
ToolTipClosedEventRequiredNone
BoundingRectangleProperty property-changed event.RequiredNone
IsOffscreenProperty property-changed event.RequiredNone
IsEnabledProperty property-changed event.RequiredNone
NameProperty property-changed event.RequiredNone
WindowVisualStateProperty property-changed event.DependsNone
AutomationFocusChangedEventRequiredNone
StructureChangedEventRequiredNone

ToolTip
UI Automation Control Types Overview
UI Automation Overview

Show: