Linguaggio

AutomationElement.IsControlElementProperty Campo

Definizione

Identifica la IsControlElement proprietà .

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 

Valore del campo

Esempio

Nell'esempio seguente viene recuperato il valore corrente della proprietà . Il valore predefinito viene restituito se l'elemento non ne fornisce uno.

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

Nell'esempio seguente viene recuperato il valore corrente della proprietà , ma viene specificato che se l'elemento stesso non fornisce un valore per la proprietà , NotSupported deve essere restituito anziché un valore predefinito.

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

Commenti

Questo identificatore viene usato dalle applicazioni client Automazione interfaccia utente. Automazione interfaccia utente provider devono usare l'identificatore equivalente in AutomationElementIdentifiers.

Questa proprietà può essere recuperata anche dalle Current proprietà o Cached .

I controlli sono elementi percepiti dall'utente come interattivi o contenenti informazioni nell'interfaccia utente.

I valori restituiti della proprietà sono di tipo Boolean. Il valore predefinito per la proprietà è true.

Si applica a

Vedi anche