UI 自动化对 Thumb 控件类型的支持UI Automation Support for the Thumb Control Type


本文档适用于想要使用 UI 自动化UI Automation 命名空间中定义的托管 System.Windows.Automation 类的 .NET Framework 开发人员。This documentation is intended for .NET Framework developers who want to use the managed UI 自动化UI Automation classes defined in the System.Windows.Automation namespace. 有关 UI 自动化UI Automation的最新信息,请参阅 Windows 自动化 API:UI 自动化For the latest information about UI 自动化UI Automation, see Windows Automation API: UI Automation.

本主题介绍 UI 自动化UI Automation 对 Thumb 控件类型的支持。This topic provides information about UI 自动化UI Automation support for the Thumb control type. UI 自动化UI Automation中,控件类型是一组条件,控件必须满足这些条件才能使用 ControlTypeProperty 属性。In UI 自动化UI Automation, a control type is a set of conditions that a control must meet in order to use the ControlTypeProperty property. 这些条件包括针对 UI 自动化UI Automation 树结构、 UI 自动化UI Automation 属性值和控件模式的特定准则。The conditions include specific guidelines for UI 自动化UI Automation tree structure, UI 自动化UI Automation property values, and control patterns.

Thumb 控件提供移动(或拖动)控件的功能(如滚动栏按钮),或调整大小的功能(如窗口调整小组件)。Thumb controls provide the functionality that enables a control to be moved (or dragged), such as a scroll bar button, or resized, such as a window resizing widget. Thumb 控件也可以作为窗格的可移动边框实现。Thumb controls can also be implemented as movable borders of panes. 请注意它不提供拖放功能。Note that it does not provide drag-and-drop functionality. Thumb 控件可以接收鼠标焦点,但通常不接收键盘焦点。Thumb controls can receive mouse focus but usually not keyboard focus. 控件开发人员必须实现该控件,使其执行相应的操作(可以是拖放或调整大小)。The control developer must implement the control so that it acts appropriately (can be dragged or resized).

以下几节定义了 Thumb 控件类型必需的 UI 自动化UI Automation 树结构、属性、控件模式和事件。The following sections define the required UI 自动化UI Automation tree structure, properties, control patterns, and events for the Thumb control type. UI 自动化UI Automation要求适用于所有 thumb 控件,无论控件是 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) Win32 还是 Windows 窗体。The UI 自动化UI Automation requirements apply to all thumb controls, whether Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF), Win32, or Windows Forms.

必需的 UI 自动化树结构Required UI Automation Tree Structure

下表描述了与缩略控件有关的 UI 自动化UI Automation 树的控件视图和内容视图,以及每个视图中可包含的内容。The following table depicts the control view and the content view of the UI 自动化UI Automation tree that pertains to thumb controls and describes what can be contained in each view. 有关 UI 自动化UI Automation 树的详细信息,请参阅 UI Automation Tree OverviewFor more information on the UI 自动化UI Automation tree, see UI Automation Tree Overview.

控件视图Control View 内容视图Content View
ThumbThumb -不适用- Not applicable

Thumb 控件永远不会显示在内容视图中,因为它们只有在通过鼠标操作时才存在。Thumb controls never appear in Content View because they only exist for being manipulated with a mouse. 尽管在 Thumb 容器上支持另一种控件模式(如 Scroll 模式、Transform 模式或 RangeValue 模式),但其功能仍然公开。Their functionality is exposed though another control pattern, such as Scroll Pattern, Transform Pattern, or RangeValue Pattern, being supported on the Thumb container.

必需的 UI 自动化属性Required UI Automation Properties

下表列出 UI 自动化UI Automation 属性,这些属性的值或定义与缩略控件尤其相关。The following table lists the UI 自动化UI Automation properties whose value or definition is especially relevant to thumb controls. 有关属性的详细信息 UI 自动化UI Automation ,请参阅客户端的 UI 自动化属性For more information on UI 自动化UI Automation properties, see UI Automation Properties for Clients.

UI 自动化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. Thumb 控件的可见客户端区域内的任何点。Any point within the visible client area of the Thumb control.
IsKeyboardFocusableProperty 请参阅注释。See notes. 如果该控件可以接收键盘焦点,则它必须支持此属性。If the control can receive keyboard focus, it must support this property.
NameProperty Null Thumb 控件在 UI 自动化树的内容视图中不可用,因此它不需要名称。The Thumb control is not available in the Content View of the UI Automation tree so it does not require a name.
LabeledByProperty Null Thumb 控件绝对不会有标签。Thumb controls never have a label.
ControlTypeProperty ThumbThumb 此值对于所有 UI 框架均相同。This value is the same for all UI frameworks.
LocalizedControlTypeProperty “缩略”"thumb" 与 Thumb 控件类型相对应的本地化字符串。Localized string corresponding to the Thumb control type.
IsContentElementProperty FalseFalse Thumb 控件绝不是内容。The Thumb control is never content.
IsControlElementProperty TrueTrue Thumb 控件必须始终为控件。The Thumb control must always be a control.

必需的 UI 自动化控件模式Required UI Automation Control Patterns

下表列出需要由缩略控件支持的 UI 自动化UI Automation 控件模式。The following table lists the UI 自动化UI Automation control patterns required to be supported by thumb controls. 有关控件模式的详细信息,请参阅 UI Automation Control Patterns OverviewFor more information on control patterns, see UI Automation Control Patterns Overview.

控件模式/模式属性Control Pattern/Pattern Property 支持/值Support/Value 注释Notes
ITransformProvider 必需Required 使缩略控件在屏幕上移动。Enables the thumb control to be moved on the screen.

必需的 UI 自动化事件Required UI Automation Events

下表列出需要由所有缩略控件支持的 UI 自动化UI Automation 事件。The following table lists the UI 自动化UI Automation events required to be supported by all thumb controls. 有关事件的详细信息,请参阅 UI Automation Events OverviewFor more information about events, see UI Automation Events Overview.

UI 自动化UI Automation 事件Event 支持Support 说明Notes
BoundingRectangleProperty 属性更改事件。BoundingRectangleProperty property-changed event. 必需Required None
IsOffscreenProperty 属性更改事件。IsOffscreenProperty property-changed event. 必需Required None
IsEnabledProperty 属性更改事件。IsEnabledProperty property-changed event. 必需Required None
AutomationFocusChangedEvent 必须Required None
StructureChangedEvent 必须Required None

另请参阅See also