UI 自动化对标准控件的支持
注意 |
---|
本文档的目标读者是欲使用 System.Windows.Automation 命名空间中定义的托管 UI Automation类的 .NET Framework 开发人员。有关 UI Automation的最新信息,请参见 Windows Automation API: UI Automation(Windows 自动化 API:UI 自动化)。 |
本主题包含有关对为 WPF、Win32 和 Windows Forms框架所开发的应用程序中标准控件的 Microsoft UI Automation支持的信息。
本主题包括下列各节。
- Windows Presentation Foundation 控件
- Win32 控件
- Windows 窗体控件
- 相关主题
Windows Presentation Foundation 控件
为用户交互提供信息或支持的所有 WPF 控件元素都具有对 UI Automation的完全本机支持。 面板等其他元素对于 UI Automation不可见。
Win32 控件
大多数 Win32 控件都通过 UIAutomationClientsideProviders.dll 中的客户端提供程序向 Microsoft UI Automation公开。 此程序集将自动注册,以用于 UI 自动化客户端应用程序。
仅对 ComCtrl32.dll 版本 6(随 Microsoft Windows XP 和更高版本提供)中的控件提供完全支持。
以下为支持的控件。
类名 |
控件类型 |
---|---|
Button |
Button |
Button |
RadioButton |
Button |
组 |
Button |
CheckBox |
Button |
Hyperlink |
Button |
SplitButton |
Button |
CheckBox |
ComboBoxEx32 |
ComboBox |
ComboBox |
ComboBox |
Edit |
Document |
Edit |
Edit |
SysLink |
Hyperlink |
Static |
Text |
Static |
Image |
SysIPAddress32 |
自定义 |
SysHeader32 |
Header/HeaderItem |
SysListView32 |
DataGrid |
SysListView32 |
List |
ListBox |
List |
ListBox |
ListItem |
#32768 |
Menu |
#32768 |
MenuItem |
msctls_progress32 |
ProgressBar |
RichEdit |
Document。 请参见“说明”。 |
RichEdit20A |
Document |
RichEdit20W |
Document |
RichEdit50W |
Document |
ScrollBar |
Slider |
msctls_trackbar32 |
Slider |
msctls_updown32 |
Spinner |
msctls_statusbar32 |
StatusBar |
SysTabControl32 |
Tab |
SysTabControl32 |
TabItem |
ToolbarWindow32 |
ToolBar |
ToolbarWindow32 |
MenuItem |
ToolbarWindow32 |
Button |
ToolbarWindow32 |
CheckBox |
ToolbarWindow32 |
RadioButton |
ToolbarWindow32 |
Separator |
tooltips_class32 |
ToolTip |
#32774 |
ToolTip |
ReBarWindow32 |
Toolbar |
SysTreeView32 |
树 |
SysTreeView32 |
TreeItem |
说明 仅在随 Windows Vista 一起提供的版本中(在 RichEd20.dll 中为版本 3.1 和更高版本,在 MsftEdit.dll 中为版本 4.1 和更高版本)支持 RichEdit 控件。
以下控件不受支持。
类名 |
控件类型 |
---|---|
SysAnimate32 |
Image |
SysPager |
Spinner |
SysDateTimePick32 |
自定义 |
SysMonthCal32 |
Calendar |
MS_WINNOTE |
工具提示 |
VBBubble |
工具提示 |
ScrollBar(在用作独立控件时) |
Slider |
SuperGrid |
自定义 |
Windows 窗体控件
Windows Forms控件通过 UIAutomationClientsideProviders.dll 中的客户端提供程序向 Microsoft UI Automation公开。 此程序集将自动注册,以用于 UI 自动化客户端应用程序。
通常,UI Automation支持作为 Win32 公共控件的托管包装的 Windows Forms控件。 以下为支持的控件。
类名 |
---|
Button |
CheckBox |
CheckedListBox |
ColorDialog |
ComboBox |
FolderBrowser |
FontDialog |
GroupBox |
HscrollBar |
ImageList |
标签 |
ListBox |
ListView |
MainMenu/ContextMenu |
MonthCalendar |
NotifyIcon |
OpenFileDialog |
PageSetupDialog |
PrintDialog |
ProgressBar |
RadioButton |
RichTextBox |
SaveFileDialog |
ScrollableControl |
SoundPlayer |
StatusBar |
TabControl/TabPage |
TextBox |
Timer |
工具栏 |
ToolTip |
TrackBar |
TreeView |
VscrollBar |
WebBrowser |
以下控件仅通过其对 Microsoft Active Accessibility 的支持向 Microsoft UI Automation公开。 一些功能可能不可用。
控件名称 |
---|
BindingSource |
DataGrid |
DataGridView |
DataNavigator |
DomainUpDown |
ErrorProvider |
FlowLayoutPanel |
Form |
LinkLabel |
HelpProvider |
MaskedTextBox |
MenuStrip/ContextMenuStrip |
NumericUpDown |
Panel |
PictureBox |
PrintDocument |
PrintPreview-Control |
PrintPreview-Dialog |
PropertyGrid |
UserControl |
ToolStrip |
TableLayoutPanel |
SplitContainer/SplitterPanel |
Splitter |
RaftingContainer |
StatusStrip |