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同等の識別子を使用する必要があります。

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

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

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

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

適用対象

こちらもご覧ください