Hyperlink Control Type
This topic provides information about Microsoft UI Automation support for the Hyperlink control type.
Hyperlink controls create links that enable users to navigate within the same page, or from one page to another.
The following sections define the required UI Automation tree structure, properties, control patterns, and events for the Hyperlink control type. The UI Automation requirements apply to all hyperlink 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
- Relevant Properties
- Required Control Patterns
- Required Events
- Related topics
Typical Tree Structure
The following table depicts a typical control and content view of the UI Automation tree that pertains to hyperlink 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 following table lists the UI Automation properties whose value or definition is especially relevant to the hyperlink controls. 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 across all controls in an application.|
|UIA_BoundingRectanglePropertyId||See notes.||The outermost rectangle that contains the whole control.|
|UIA_ClickablePointPropertyId||See notes.||The hyperlink control's clickable point must be a point that launches the hyperlink if clicked with a mouse pointer.|
|UIA_IsContentElementPropertyId||TRUE||The hyperlink control is always included in the content view of the UI Automation tree.|
|UIA_IsControlElementPropertyId||TRUE||The hyperlink 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||See notes.||If there is a static text label, this property must expose a reference to that control.|
|UIA_LocalizedControlTypePropertyId||See notes.||Localized string corresponding to the Hyperlink control type. The default value is "hyperlink" for en-US or English (United States).|
|UIA_NamePropertyId||See notes.||The hyperlink control's name is the text that is displayed on the screen as underlined.|
Required Control Patterns
The following table lists the UI Automation control patterns that hyperlink controls are required to support. For more information on control patterns, see UI Automation Control Patterns Overview.
|Control Pattern/Pattern Property||Support/Value||Notes|
|IInvokeProvider||Required||All hyperlink controls must support the Invoke control pattern.|
|IValueProvider||Depends||Hyperlink controls should support the Value control pattern when the link contains information that is usable and meaningful to the user.|
|Value||For example, "https://www..."||A URL for an Internet or intranet address is an example of a hyperlink that contains information that is meaningful to the user. A programmatic link, however, is meaningful only to an application and is not recommended for the Value property.|
The following table lists the UI Automation events that hyperlink 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.|
The Hyperlink control type should be applied only to an object that, when clicked, causes navigation to occur; it should not be applied to the container of the hyperlink. For example, only the clickable "hot spots" inside an image map should have the Hyperlink control type. The same is true of hyperlinks in a text field or document container. In this case, only the hyperlink text or image should have the Hyperlink control type, not the container.
The Text control pattern is ideal for supporting embedded hyperlinks in text or document elements.