AutomationElement.LabeledByProperty フィールド

定義

コントロールに関連付けられたラベルを識別する LabeledBy プロパティを識別します。

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

フィールド値

次の例では、 プロパティの現在の値を取得します。 要素に指定されていない場合は、既定値が返されます。

AutomationElement labeler =
    autoElement.GetCurrentPropertyValue(AutomationElement.LabeledByProperty) as AutomationElement;
Dim labeler As AutomationElement = _
    DirectCast(autoElement.GetCurrentPropertyValue(AutomationElement.LabeledByProperty), _
    AutomationElement)

次の例では、 プロパティの現在の値を取得しますが、要素自体がプロパティの値を提供しない場合は、 NotSupported 既定値ではなく を返すように指定します。

AutomationElement labeler1;
object labelerNoDefault =
    autoElement.GetCurrentPropertyValue(AutomationElement.LabeledByProperty, true);
if (labelerNoDefault == AutomationElement.NotSupported)
{
    // TODO Handle the case where you do not wish to proceed using the default value.
}
else
{
    labeler1 = labelerNoDefault as AutomationElement;
}
Dim labeler1 As AutomationElement
Dim labelerNoDefault As Object = autoElement.GetCurrentPropertyValue(AutomationElement.LabeledByProperty, True)
If labelerNoDefault Is AutomationElement.NotSupported Then
    ' TODO Handle the case where you do not wish to proceed using the default value.
Else
    labeler1 = DirectCast(labelerNoDefault, AutomationElement)
End If

注釈

この識別子は、UI オートメーション クライアント アプリケーションで使用されます。 UI オートメーション プロバイダーでは、 で AutomationElementIdentifiers同等の識別子を使用する必要があります。

このプロパティは、 または Cached プロパティからCurrent取得することもできます。

プロパティの戻り値は 型 AutomationElementです。 プロパティの既定値は です null

適用対象

こちらもご覧ください