AutomationElement.HelpTextProperty 欄位

定義

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

欄位值

範例

下列範例會擷取 屬性的目前值。 如果專案未提供預設值,則會傳回預設值。

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

下列範例會擷取屬性的目前值,但指定如果專案本身未提供屬性的值, NotSupported 則會傳回 而不是預設值。

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

備註

使用者介面自動化用戶端應用程式會使用此識別碼。 使用者介面自動化提供者應該使用 中的 AutomationElementIdentifiers 對等識別碼。

您也可以從 CurrentCached 屬性擷取這個屬性。

此資訊通常是從提供者所指定的工具提示取得。

屬性的傳回值的類型為 String 。 屬性的預設值是空字串。

適用於

另請參閱