AutomationElement.ItemStatusProperty フィールド

定義

複雑な項目の視覚的表現のステータスを指定する ItemStatus プロパティを識別します。

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

フィールド値

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

string itemStatus =
    autoElement.GetCurrentPropertyValue(AutomationElement.ItemStatusProperty) as string;
Dim itemStatus As String = _
    CStr(autoElement.GetCurrentPropertyValue(AutomationElement.ItemStatusProperty))

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

string itemStatus1;
object itemStatusNoDefault =
    autoElement.GetCurrentPropertyValue(AutomationElement.ItemStatusProperty, true);
if (itemStatusNoDefault == AutomationElement.NotSupported)
{
    // TODO Handle the case where you do not wish to proceed using the default value.
}
else
{
    itemStatus1 = itemStatusNoDefault as string;
}
Dim itemStatus1 As String
Dim itemStatusNoDefault As Object = _
    autoElement.GetCurrentPropertyValue(AutomationElement.ItemStatusProperty, True)
If itemStatusNoDefault Is AutomationElement.NotSupported Then
    ' TODO Handle the case where you do not wish to proceed using the default value.
Else
    itemStatus1 = CStr(itemStatusNoDefault)
End If

注釈

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

戻り値は、コントロールで定義 Stringされた です。 既定値は空の文字列です。

適用対象

こちらもご覧ください