AutomationElement.LabeledByProperty フィールド
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
コントロールに関連付けられているラベルを識別する 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 で同等の識別子を使用する必要があります。
このプロパティは、 Current または Cached プロパティから取得することもできます。
プロパティの戻り値は、 AutomationElement型です。 プロパティの既定値は null です。