AutomationElement.HelpTextProperty Fält

Definition

Identifierar egenskapen HelpText .

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 

Fältvärde

Exempel

I följande exempel hämtas det aktuella värdet för egenskapen. Standardvärdet returneras om elementet inte tillhandahåller något.

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

I följande exempel hämtas det aktuella värdet för egenskapen, men anger att om själva elementet inte tillhandahåller något värde för egenskapen NotSupported , returneras i stället för ett standardvärde.

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

Kommentarer

Den här identifieraren används av UI Automation klientprogram. UI Automation providers bör använda motsvarande identifierare i AutomationElementIdentifiers.

Den här egenskapen kan också hämtas från Current egenskaperna eller Cached .

Den här informationen hämtas vanligtvis från knappbeskrivningar som anges av leverantörer.

Returvärden för egenskapen är av typen String. Standardvärdet för egenskapen är en tom sträng.

Gäller för

Se även