AutomationElement.ControlTypeProperty Veld
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Identificeert de ControlType eigenschap.
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
Waarde van veld
Voorbeelden
In het volgende voorbeeld wordt de huidige waarde van de eigenschap opgehaald. De standaardwaarde wordt geretourneerd als het element er geen opgeeft.
ControlType controlTypeId =
autoElement.GetCurrentPropertyValue(AutomationElement.ControlTypeProperty)
as ControlType;
Dim controlTypeId As ControlType = _
DirectCast(autoElement.GetCurrentPropertyValue(AutomationElement.ControlTypeProperty), ControlType)
In het volgende voorbeeld wordt de huidige waarde van de eigenschap opgehaald, maar wordt aangegeven dat als het element zelf geen waarde voor de eigenschap biedt, NotSupported moet worden geretourneerd in plaats van een standaardwaarde.
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
Opmerkingen
Deze id wordt gebruikt door UI Automation clienttoepassingen. UI Automation providers moeten de equivalente id in AutomationElementIdentifiers gebruiken.
Deze eigenschap kan ook worden opgehaald uit de Current of Cached eigenschappen.
De standaardwaarde voor de eigenschap is Custom
Van toepassing op
Zie ook
- Overzicht van UI Automation-eigenschappen
- UI-automatiseringsbedieningstypen