Share via


AutomationElement.ItemTypeProperty 필드

정의

ItemType 속성을 식별합니다.

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

필드 값

AutomationProperty

예제

다음 예제에서는 속성의 현재 값을 검색 합니다. 요소 하나를 제공 하지 않는 경우 기본값 반환 됩니다.

string itemType =
    autoElement.GetCurrentPropertyValue(AutomationElement.ItemTypeProperty) as string;
Dim itemType As String = _
    CStr(autoElement.GetCurrentPropertyValue(AutomationElement.ItemTypeProperty))

다음 예제에서는 속성의 현재 값을 검색 하지만, 요소 자체 속성의 값을 제공 하지 않습니다 하는 경우는 애플리케이션 정의 문자열 임을 지정 기본값 대신 반환할 합니다.

string itemType1;
object itemTypeNoDefault =
    autoElement.GetCurrentPropertyValue(AutomationElement.ItemTypeProperty, true);
if (itemTypeNoDefault == AutomationElement.NotSupported)
{
    itemType1 = "Unknown type";
}
else
{
    itemType1 = itemStatusNoDefault as string;
}
Dim itemType1 As String
Dim itemTypeNoDefault As Object = _
    autoElement.GetCurrentPropertyValue(AutomationElement.ItemTypeProperty, True)
If itemTypeNoDefault Is AutomationElement.NotSupported Then
    itemType1 = "Unknown type"
Else
    itemType1 = CStr(itemStatusNoDefault)
End If

설명

이 식별자는 UI 자동화 클라이언트 애플리케이션에서 사용 됩니다. UI 자동화 공급자에서 해당 식별자를 사용 해야 AutomationElementIdentifiers합니다.

이 속성을 검색할 수도 있습니다는 Current 또는 Cached 속성입니다.

반환 값은 컨트롤이 정의 String합니다. 기본값은 빈 문자열입니다.

적용 대상

추가 정보