AutomationElement.AutomationElementInformation AutomationElement.AutomationElementInformation AutomationElement.AutomationElementInformation AutomationElement.AutomationElementInformation Struct

定義

包含 CachedCurrent 屬性所使用的屬性存取子。Contains the property accessors used by the Cached or Current properties.

public: value class AutomationElement::AutomationElementInformation
public struct AutomationElement.AutomationElementInformation
type AutomationElement.AutomationElementInformation = struct
Public Structure AutomationElement.AutomationElementInformation
繼承
AutomationElement.AutomationElementInformationAutomationElement.AutomationElementInformationAutomationElement.AutomationElementInformationAutomationElement.AutomationElementInformation

範例

下列範例顯示如何Name從此結構抓取屬性。The following example shows how the Name property is retrieved from this structure.

/// <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

備註

屬性可以直接從CachedCurrent存取, 您AutomationElement.AutomationElementInformation不需要取得結構本身。The properties can be accessed directly from Cached and Current; you do not need to retrieve the AutomationElement.AutomationElementInformation structure itself.

您也可以使用GetCurrentPropertyValueGetCachedPropertyValue, 從AutomationElement使用對應的識別碼, 來抓取此結構中的屬性。The properties in this structure can also be retrieved by using GetCurrentPropertyValue and GetCachedPropertyValue, using the corresponding identifiers from AutomationElement. 例如, AutomationElement.AutomationElementInformation.AcceleratorKey屬性是AutomationElement.AcceleratorKeyProperty由欄位所識別。For example, The AutomationElement.AutomationElementInformation.AcceleratorKey property is identified by the AutomationElement.AcceleratorKeyProperty field. 有關個別屬性的詳細資訊可在這些識別碼的參考頁面上取得。請參閱每個參考主題的「備註」一節中的連結。More information about the individual properties is available on the reference pages for those identifiers; see the link in the Remarks section of each reference topic.

屬性

AcceleratorKey AcceleratorKey AcceleratorKey AcceleratorKey

取得的字串包含項目的快速鍵組合。Gets a string containing the accelerator key combinations for the element.

AccessKey AccessKey AccessKey AccessKey

取得的字串包含項目的便捷鍵字元。Gets a string containing the access key character for the element.

AutomationId AutomationId AutomationId AutomationId

取得包含項目之 UI 自動化UI Automation 識別項 (ID)identifier (ID) 的字串。Gets a string containing the UI 自動化UI Automation 識別項 (ID)identifier (ID) for the element.

BoundingRectangle BoundingRectangle BoundingRectangle BoundingRectangle

取得完全圍住項目的矩形座標。Gets the coordinates of the rectangle that completely encloses the element.

ClassName ClassName ClassName ClassName

取得的字串包含控制項開發人員指定之項目的類別名稱。Gets a string containing the class name of the element as assigned by the control developer.

ControlType ControlType ControlType ControlType

取得項目的 ControlTypeGets the ControlType of the element.

FrameworkId FrameworkId FrameworkId FrameworkId

取得基礎 UI 架構的名稱。Gets the name of the underlying UI framework.

HasKeyboardFocus HasKeyboardFocus HasKeyboardFocus HasKeyboardFocus

取得的值指出項目是否有鍵盤焦點。Gets a value that indicates whether the element has keyboard focus.

HelpText HelpText HelpText HelpText

取得與項目相關的說明文字。Gets the help text associated with the element.

IsContentElement IsContentElement IsContentElement IsContentElement

取得的值指出項目是否為內容項目。Gets a value that specifies whether the element is a content element.

IsControlElement IsControlElement IsControlElement IsControlElement

取得的值指出是否將項目視為控制項。Gets a value that indicates whether the element is viewed as a control.

IsEnabled IsEnabled IsEnabled IsEnabled

取得的值指出 使用者介面 (UI)user interface (UI)參考的UI 自動化UI Automation 項目是否已啟用。Gets a value that indicates whether the 使用者介面 (UI)user interface (UI) item referenced by the UI 自動化UI Automation element is enabled.

IsKeyboardFocusable IsKeyboardFocusable IsKeyboardFocusable IsKeyboardFocusable

取得的值指示 UI 自動化UI Automation項目能否接受鍵盤焦點。Gets a value that indicates whether the UI 自動化UI Automation element can accept keyboard focus.

IsOffscreen IsOffscreen IsOffscreen IsOffscreen

取得的值表示螢幕上是否能看見 UI 自動化UI Automation項目。Gets a value that indicates whether the UI 自動化UI Automation element is visible on the screen.

IsPassword IsPassword IsPassword IsPassword

取得的值表示 UI 自動化UI Automation項目是否包含受保護的內容。Gets a value that indicates whether the UI 自動化UI Automation element contains protected content.

IsRequiredForForm IsRequiredForForm IsRequiredForForm IsRequiredForForm

取得的值指示表單上的 UI 自動化UI Automation項目是否為必填。Gets a value that indicates whether the UI 自動化UI Automation element is required to be filled out on a form.

ItemStatus ItemStatus ItemStatus ItemStatus

取得的描述會說明項目 (element) 內某項目 (item) 的狀態。Gets a description of the status of an item within an element.

ItemType ItemType ItemType ItemType

取得說明項目型別的描述。Gets a description of the type of an item.

LabeledBy LabeledBy LabeledBy LabeledBy

取得的項目包含此項目的文字標籤。Gets the element that contains the text label for this element.

LocalizedControlType LocalizedControlType LocalizedControlType LocalizedControlType

取得控制項類型的描述。Gets a description of the control type.

Name Name Name Name

取得項目的名稱。Gets the name of the element.

NativeWindowHandle NativeWindowHandle NativeWindowHandle NativeWindowHandle

取得項目之視窗的控制代碼。Gets the handle of the element's window.

Orientation Orientation Orientation Orientation

取得控制項的方向。Gets the orientation of the control.

ProcessId ProcessId ProcessId ProcessId

取得項目的處理序識別項 (ID)identifier (ID)Gets the process 識別項 (ID)identifier (ID) of this element.

適用於

另請參閱