語言

AutomationElement.LocalizedControlTypeProperty 欄位

定義

以當地語言標示該 LocalizedControlType 物業。

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

欄位值

範例

以下範例取得該屬性的當前值。 若元素未提供預設值,則回傳預設值。

string localizedType =
    autoElement.GetCurrentPropertyValue(AutomationElement.LocalizedControlTypeProperty) as string;
Dim localizedType As String = _
    Cstr(autoElement.GetCurrentPropertyValue(AutomationElement.LocalizedControlTypeProperty))

以下範例取得該屬性的當前值,但指定若元素本身未提供屬性值, NotSupported 則回傳該屬性而非預設值。

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

備註

此識別碼用於 使用者介面自動化 客戶端應用程式。 使用者介面自動化提供者應使用等效的識別碼為 AutomationElementIdentifiers。

此屬性也可從 Current 或 Cached 屬性中取得。

當此屬性代表沒有明確定義的控制類型時,提供者必須公開此屬性。

屬性的回傳值型別 String為 。 屬性的預設值為空字串。

適用於

另請參閱