AutomationElement.AutomationElementInformation 结构    
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
public: value class AutomationElement::AutomationElementInformation
	public struct AutomationElement.AutomationElementInformation
	type AutomationElement.AutomationElementInformation = struct
	Public Structure AutomationElement.AutomationElementInformation
		- 继承
 
示例
以下示例演示如何 Name 从此 结构检索 属性。
/// <summary>
/// Handles ElementSelected events by showing a message.
/// </summary>
/// <param name="src">Object that raised the event; in this case, a list item.</param>
/// <param name="e">Event arguments.</param>
private void OnSelect(object src, AutomationEventArgs e)
{
    // Get the name of the item, which is equivalent to its text.
    AutomationElement element = src as AutomationElement;
    if (element != null)
    {
        Console.WriteLine(element.Current.Name + " was selected.");
    }
}
''' <summary>
''' Handles ElementSelected events by showing a message.
''' </summary>
''' <param name="src">Object that raised the event; in this case, a list item.</param>
''' <param name="e">Event arguments.</param>
Private Sub OnSelect(ByVal src As Object, ByVal e As AutomationEventArgs)
    ' Get the name of the item, which is equivalent to its text.
    Dim element As AutomationElement = DirectCast(src, AutomationElement)
    If (element IsNot Nothing) Then
        Console.WriteLine(element.Current.Name + " was selected.")
    End If
End Sub
	注解
可以直接从 Cached 和 Current访问属性;无需检索 AutomationElement.AutomationElementInformation 结构本身。
还可以使用 GetCurrentPropertyValue 和 GetCachedPropertyValue检索此结构中的属性,并使用 中的 AutomationElement相应标识符。 例如, 属性 AutomationElement.AutomationElementInformation.AcceleratorKey 由 AutomationElement.AcceleratorKeyProperty 字段标识。 有关各个属性的详细信息,请参阅这些标识符的参考页;请参阅每个参考主题的“备注”部分中的链接。
属性
| AcceleratorKey | 
		 获取一个包含元素快捷键组合的字符串。  | 
        	
| AccessKey | 
		 获取一个包含元素的访问键字符的字符串。  | 
        	
| AutomationId | 
		 获取一个字符串,其中包含元素的 UI 自动化标识符 (ID) 。  | 
        	
| BoundingRectangle | 
		 获取完全包围元素的矩形的坐标。  | 
        	
| ClassName | 
		 获取一个字符串,其中包含由控件开发人员分配的元素的类名称。  | 
        	
| ControlType | 
		 获取元素的 ControlType。  | 
        	
| FrameworkId | 
		 获取基础 UI 框架的名称。  | 
        	
| HasKeyboardFocus | 
		 获取一个值,该值指示此元素是否具有键盘焦点。  | 
        	
| HelpText | 
		 获取与元素关联的帮助文本。  | 
        	
| IsContentElement | 
		 获取一个值,该值指定元素是否为内容元素。  | 
        	
| IsControlElement | 
		 获取一个值,该值指示元素是否以控件的形式查看。  | 
        	
| IsEnabled | 
		 获取一个值,该值指示是否启用 UI 自动化元素引用的用户界面 (UI) 项。  | 
        	
| IsKeyboardFocusable | 
		 获取一个值,该值指示 UI 自动化元素是否可以接受键盘焦点。  | 
        	
| IsOffscreen | 
		 获取一个值,该值指示 UI 自动化元素是否在屏幕上可见。  | 
        	
| IsPassword | 
		 获取一个值,该值指示 UI 自动化元素是否包含受保护的内容。  | 
        	
| IsRequiredForForm | 
		 获取一个值,该值指示是否需要在窗体上填写 UI 自动化元素。  | 
        	
| ItemStatus | 
		 获取元素内某一项的状态说明。  | 
        	
| ItemType | 
		 获取一个项的类型说明。  | 
        	
| LabeledBy | 
		 获取包含此元素的文本标签的元素。  | 
        	
| LocalizedControlType | 
		 获取控件类型的说明。  | 
        	
| Name | 
		 获取元素的名称。  | 
        	
| NativeWindowHandle | 
		 获取元素窗口的句柄。  | 
        	
| Orientation | 
		 获取控件的方向。  | 
        	
| ProcessId | 
		 获取此元素的进程标识符 (ID) 。  |