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

Definition

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
Inheritance
AutomationElement.AutomationElementInformationAutomationElement.AutomationElementInformationAutomationElement.AutomationElementInformationAutomationElement.AutomationElementInformation

Examples

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 'OnSelect

Remarks

The properties can be accessed directly from Cached and Current; you do not need to retrieve the AutomationElement.AutomationElementInformation structure itself.

The properties in this structure can also be retrieved by using GetCurrentPropertyValue and GetCachedPropertyValue, using the corresponding identifiers from AutomationElement. 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.

Properties

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

Gets a string containing the UI Automation 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

Gets the ControlType of the element.

FrameworkId FrameworkId FrameworkId FrameworkId

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

Gets a value that indicates whether the user interface (UI) item referenced by the UI Automation element is enabled.

IsKeyboardFocusable IsKeyboardFocusable IsKeyboardFocusable IsKeyboardFocusable

Gets a value that indicates whether the UI Automation element can accept keyboard focus.

IsOffscreen IsOffscreen IsOffscreen IsOffscreen

Gets a value that indicates whether the UI Automation element is visible on the screen.

IsPassword IsPassword IsPassword IsPassword

Gets a value that indicates whether the UI Automation element contains protected content.

IsRequiredForForm IsRequiredForForm IsRequiredForForm IsRequiredForForm

Gets a value that indicates whether the UI Automation element is required to be filled out on a form.

ItemStatus ItemStatus ItemStatus ItemStatus

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

Gets the process identifier (ID) of this element.

Applies to

See also