AutomationElement.IsControlElementProperty Pole

Definicja

Identyfikuje IsControlElement właściwość .

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

Wartość pola

Przykłady

Poniższy przykład pobiera bieżącą wartość właściwości. Wartość domyślna jest zwracana, jeśli element nie podaje go.

bool isControl = (bool)
   autoElement.GetCurrentPropertyValue(AutomationElement.IsControlElementProperty);
Dim isControl As Boolean = CBool(autoElement.GetCurrentPropertyValue(AutomationElement.IsControlElementProperty))

Poniższy przykład pobiera bieżącą wartość właściwości, ale określa, że jeśli sam element nie podaje wartości właściwości, NotSupported należy zwrócić zamiast wartości domyślnej.

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

Uwagi

Ten identyfikator jest używany przez aplikacje klienckie automatyzacja interfejsu użytkownika. automatyzacja interfejsu użytkownika dostawcy powinni użyć równoważnego identyfikatora w pliku AutomationElementIdentifiers.

Tę właściwość można również pobrać z Current właściwości lub Cached .

Kontrolki to elementy, które użytkownik postrzega jako interaktywne lub zawierające informacje w interfejsie użytkownika.

Zwracane wartości właściwości są typu Boolean. Wartość domyślna właściwości to true.

Dotyczy

Zobacz też