Dela via


UI Automation Support for the Document Control Type

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 Document 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.

Document controls let a user view and manipulate multiple pages of text. Unlike edit controls which only support a simple line of unformatted text, document controls can host text that is richly styled and formatted.

The following sections define the required UI Automation tree structure, properties, control patterns, and events for the Document control type. The UI Automation requirements apply to all document controls, whether Windows Presentation Foundation (WPF), 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 document 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

Document

  • Varies

Document

  • Varies

Required UI Automation Properties

The following table lists the UI Automation properties whose value or definition is especially relevant to document controls. For more information on 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 document has a clickable point that will cause the document of one of its elements in the document container to have focus.

ControlTypeProperty

Document

This value is the same for all UI frameworks.

IsContentElementProperty

True

The document control is always included in the content view of the UI Automation tree.

IsControlElementProperty

True

The document control is always included in the control view of the UI Automation tree.

IsKeyboardFocusableProperty

See notes.

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

LabeledByProperty

See notes.

The value of this property should be the label of the document control. Typically, the title of the document is used.

LocalizedControlTypeProperty

"document"

Localized string corresponding to the Document control type.

NameProperty

See notes.

The document control typically gets its names from the file name it is loaded from. This is often displayed in a containing window or frame title.

Required UI Automation Control Patterns

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

Control Pattern

Support

Notes

IScrollProvider

Depends

The document control can span larger than that span of the viewport. The control should support the Scroll control pattern if the content is scrollable.

ITextProvider

Required

The document control can span larger than that span of the viewport. The control should support the Scroll control pattern if the content is scrollable.

IValueProvider

Never

The document control does not support this control pattern because the contents of the control often span more than one page. UI Automation clients should use TextPattern to obtain text information about a document.

Required UI Automation Events

The following table lists the UI Automation events required to be supported by all document controls. For more information about events, see UI Automation Events Overview.

UI Automation Event

Support

Notes

AutomationFocusChangedEvent

Required

None

BoundingRectangleProperty property-changed event.

Required

None

IsEnabledProperty property-changed event.

Required

None

IsOffscreenProperty property-changed event.

Required

None

StructureChangedEvent

Required

None

HorizontallyScrollableProperty property-changed event.

Required

None

HorizontalScrollPercentProperty property-changed event.

Required

None

HorizontalViewSizeProperty property-changed event.

Required

None

VerticalScrollPercentProperty property-changed event.

Required

None

VerticallyScrollableProperty property-changed event.

Required

None

VerticalViewSizeProperty property-changed event.

Required

None

InvalidatedEvent

Depends

If the control supports the Selection control pattern, it must support this event.

TextSelectionChangedEvent

Required

None

TextChangedEvent

Required

None

ValueProperty property-changed event.

Never

None

See Also

Reference

Document

Concepts

UI Automation Control Types Overview

UI Automation Overview