AutomationElement.ControlTypeProperty フィールド

定義

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

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

フィールド値

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

ControlType controlTypeId = 
    autoElement.GetCurrentPropertyValue(AutomationElement.ControlTypeProperty)
    as ControlType;
Dim controlTypeId As ControlType = _
  DirectCast(autoElement.GetCurrentPropertyValue(AutomationElement.ControlTypeProperty), ControlType)

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

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

注釈

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

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

プロパティの既定値は です。 Custom

適用対象

こちらもご覧ください