AutomationElement.IsContentElementProperty フィールド

定義

IsContentElement プロパティを識別します。

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

フィールド値

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

bool isContent = (bool)
   autoElement.GetCurrentPropertyValue(AutomationElement.IsContentElementProperty);
Dim isContent As Boolean = CBool(autoElement.GetCurrentPropertyValue(AutomationElement.IsContentElementProperty))

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

bool isContent1;
object isContentNoDefault =
    autoElement.GetCurrentPropertyValue(AutomationElement.IsContentElementProperty, true);
if (isContentNoDefault == AutomationElement.NotSupported)
{
    // TODO Handle the case where you do not wish to proceed using the default value.
}
else
{
    isContent1 = (bool)isContentNoDefault;
}
Dim isContent1 As Boolean
Dim isContentNoDefault As Object = autoElement.GetCurrentPropertyValue(AutomationElement.IsContentElementProperty, True)
If isContentNoDefault Is AutomationElement.NotSupported Then
    ' TODO Handle the case where you do not wish to proceed using the default value.
Else
    isContent1 = CBool(isContentNoDefault)
End If

注釈

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

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

UI オートメーション ツリーのコンテンツ ビューは、UI 内のデータを表す要素のみを含む UI のビューを提供します。

要素は、コンテンツを保持できるコントロールである必要があります。

プロパティの戻り値は、 Boolean型です。 プロパティの既定値は true です。

適用対象

こちらもご覧ください