UI 自動化用戶端的控制項模式對應Control Pattern Mapping for UI Automation Clients

注意

這份文件適用於想要使用 System.Windows.Automation 命名空間中定義之 Managed UI 自動化UI 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 Automation API:使用者介面自動化。For the latest information about UI 自動化UI Automation, see Windows Automation API: UI Automation.

本主題列出控制項類型及其相關聯的控制項模式。This topic lists control types and their associated control patterns.

下表將控制項模式整理為下列類別:The following table organizes the control patterns into the following categories:

  • 支援。Supported. 控制項必定支援此控制項模式。The control must support this control pattern.

  • 有條件支援。Conditional support. 控制項可依據控制項的狀態決定是否支援此控制項模式。The control may support this control pattern depending on the state of the control.

  • 不支援。Not supported. 控制項不支援此控制項模式;自訂控制項可能支援此控制項模式。The control does not support this control pattern; custom controls may support this control pattern.

注意

有些控制項會依據其功能,有條件支援多種控制項模式。Some controls have conditional support for several control patterns depending on the functionality of the control. 例如,功能表項目控制項即依據其在功能表控制項中的功能,有條件支援 InvokePatternExpandCollapsePatternTogglePatternSelectionItemPattern 控制項模式。For example, the menu item control has conditional support for the InvokePattern, ExpandCollapsePattern, TogglePattern, or SelectionItemPattern control pattern, depending on its function in the menu control.

用戶端的 UI 自動化控制項模式UI Automation Control Patterns for Clients

控制項類型Control Type 支援Supported 有條件支援。Conditional Support 不支援Not Supported
按鈕Button None 叫用、切換、展開摺疊Invoke, Toggle, Expand Collapse None
行事曆Calendar 方格、表格Grid, Table 選取、捲軸Selection, Scroll Value
核取方塊Check Box ToggleToggle NoneNone None
下拉式方塊Combo Box 展開摺疊Expand Collapse 選取、值Selection, Value ScrollScroll
資料格Data Grid GridGrid 捲軸、選取、表格Scroll, Selection, Table None
Data ItemData Item Selection ItemSelection Item 展開摺疊、方格項目、捲軸項目、表格、切換、值Expand Collapse, Grid Item, Scroll Item, Table, Toggle, Value NoneNone
文件Document 文字Text 捲軸、值Scroll, Value NoneNone
編輯Edit NoneNone 文字、範圍值、值Text, Range Value, Value None
群組Group NoneNone 展開摺疊Expand Collapse None
頁首Header None 資料轉換Transform None
標題項目Header Item None 轉換、叫用Transform, Invoke None
超連結Hyperlink 叫用Invoke Value NoneNone
ImageImage None 方格項目、表格項目Grid Item, Table Item 叫用、選取項目Invoke, Selection Item
清單List NoneNone 方格、多重檢視、捲軸、選取Grid, Multiple View, Scroll, Selection 資料表Table
清單項目List Item Selection ItemSelection Item 展開摺疊、方格項目、叫用、捲軸項目 、切換、值Expand Collapse, Grid Item, Invoke, Scroll Item, Toggle, Value None
功能表Menu None NoneNone None
功能表列Menu Bar None 展開摺疊、停駐、轉換Expand Collapse, Dock, Transform None
功能表項目Menu Item None 展開摺疊、叫用、選取項目、切換Expand Collapse, Invoke, Selection Item, Toggle NoneNone
窗格Pane None 停駐Dock. 捲軸、轉換Scroll, Transform 視窗Window
進度列Progress Bar None 範圍值、值Range Value, Value None
選項按鈕Radio Button Selection ItemSelection Item None ToggleToggle
Scroll BarScroll Bar None Range ValueRange Value ScrollScroll
SeparatorSeparator None NoneNone NoneNone
滑桿Slider None 範圍值、選取、值Range Value, Selection, Value None
SpinnerSpinner NoneNone 範圍值、選取、值Range Value, Selection, Value NoneNone
Split ButtonSplit Button 叫用、展開摺疊Invoke, Expand Collapse NoneNone None
狀態列Status Bar NoneNone GridGrid None
索引標籤Tab 選取Selection ScrollScroll NoneNone
索引標籤項目Tab Item Selection ItemSelection Item None 叫用Invoke
資料表Table 方格、方格項目、表格、表格項目Grid, Grid Item, Table, Table Item None None
文字Text None 方格項目、表格項目、文字Grid Item, Table Item, Text Value
ThumbThumb 資料轉換Transform None NoneNone
標題列Title Bar None NoneNone None
工具列Tool Bar None 停駐、展開摺疊、轉換Dock, Expand Collapse, Transform None
工具提示Tool Tip None 文字、視窗Text, Window NoneNone
樹狀結構Tree None 捲軸、選取Scroll, Selection None
樹狀目錄項目Tree Item 展開摺疊Expand Collapse 叫用、捲軸項目、選取項目、切換Invoke, Scroll Item, Selection Item, Toggle NoneNone
視窗Window 轉換、視窗Transform, Window 停駐Dock None

注意

如果控制項類型沒有所列的受支援控制項模式,但有一或多個有條件支援的控制項模式,就會一律支援其中一個條件式控制項模式。If a control type has no supported control patterns listed but has one or more conditionally-supported control patterns, then one of those conditional control patterns will be supported at all times.

另請參閱See also