AutomationElement.HelpTextProperty Field

Definition

Identifies the HelpText property.

public: static initonly System::Windows::Automation::AutomationProperty ^ HelpTextProperty;
public static readonly System.Windows.Automation.AutomationProperty HelpTextProperty;
 staticval mutable HelpTextProperty : System.Windows.Automation.AutomationProperty
Public Shared ReadOnly HelpTextProperty As AutomationProperty 

Field Value

Examples

The following example retrieves the current value of the property. The default value is returned if the element does not provide one.

// elementList is an AutomationElement.
string helpString =
    elementList.GetCurrentPropertyValue(AutomationElement.HelpTextProperty) as string;
' elementList is an AutomationElement.
Dim helpString As String = _
    CStr(elementList.GetCurrentPropertyValue(AutomationElement.HelpTextProperty))

The following example retrieves the current value of the property, but specifies that if the element itself does not provide a value for the property, NotSupported is to be returned instead of a default value.

// elementList is an AutomationElement.
object help = elementList.GetCurrentPropertyValue(AutomationElement.HelpTextProperty, true);
if (help == AutomationElement.NotSupported)
{
    help = "No help available";
}
string helpText = (string)help;
' elementList is an AutomationElement.
Dim help As Object = elementList.GetCurrentPropertyValue(AutomationElement.HelpTextProperty, True)
If help Is AutomationElement.NotSupported Then
    help = "No help available"
End If
Dim helpText As String = CStr(help)

Remarks

This identifier is used by UI Automation client applications. UI Automation providers should use the equivalent identifier in AutomationElementIdentifiers.

This property can also be retrieved from the Current or Cached properties.

This information is typically obtained from tooltips specified by providers.

Return values of the property are of type String. The default value for the property is an empty string.

Applies to

See also