AutomationElement.AutomationElementInformation Structure

 

Contains the property accessors used by the Cached or Current properties.

Namespace:   System.Windows.Automation
Assembly:  UIAutomationClient (in UIAutomationClient.dll)

Public Structure AutomationElementInformation

NameDescription
System_CAPS_pubpropertyAcceleratorKey

Gets a string containing the accelerator key combinations for the element.

System_CAPS_pubpropertyAccessKey

Gets a string containing the access key character for the element.

System_CAPS_pubpropertyAutomationId

Gets a string containing the UI Automation identifier (ID) for the element.

System_CAPS_pubpropertyBoundingRectangle

Gets the coordinates of the rectangle that completely encloses the element.

System_CAPS_pubpropertyClassName

Gets a string containing the class name of the element as assigned by the control developer.

System_CAPS_pubpropertyControlType

Gets the ControlType of the element.

System_CAPS_pubpropertyFrameworkId

Gets the name of the underlying UI framework.

System_CAPS_pubpropertyHasKeyboardFocus

Gets a value that indicates whether the element has keyboard focus.

System_CAPS_pubpropertyHelpText

Gets the help text associated with the element.

System_CAPS_pubpropertyIsContentElement

Gets a value that specifies whether the element is a content element.

System_CAPS_pubpropertyIsControlElement

Gets a value that indicates whether the element is viewed as a control.

System_CAPS_pubpropertyIsEnabled

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

System_CAPS_pubpropertyIsKeyboardFocusable

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

System_CAPS_pubpropertyIsOffscreen

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

System_CAPS_pubpropertyIsPassword

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

System_CAPS_pubpropertyIsRequiredForForm

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

System_CAPS_pubpropertyItemStatus

Gets a description of the status of an item within an element.

System_CAPS_pubpropertyItemType

Gets a description of the type of an item.

System_CAPS_pubpropertyLabeledBy

Gets the element that contains the text label for this element.

System_CAPS_pubpropertyLocalizedControlType

Gets a description of the control type.

System_CAPS_pubpropertyName

Gets the name of the element.

System_CAPS_pubpropertyNativeWindowHandle

Gets the handle of the element's window.

System_CAPS_pubpropertyOrientation

Gets the orientation of the control.

System_CAPS_pubpropertyProcessId

Gets the process identifier (ID) of this element.

NameDescription
System_CAPS_pubmethodEquals(Object)

Indicates whether this instance and a specified object are equal.(Inherited from ValueType.)

System_CAPS_pubmethodGetHashCode()

Returns the hash code for this instance.(Inherited from ValueType.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns the fully qualified type name of this instance.(Inherited from ValueType.)

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.

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

.NET Framework
Available since 3.0

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: