AutomationElement.ControlTypeProperty Campo
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Identifica a ControlType propriedade.
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
Valor de Campo
Exemplos
O exemplo seguinte recupera o valor atual da propriedade. O valor padrão é devolvido se o elemento não fornecer um.
ControlType controlTypeId =
autoElement.GetCurrentPropertyValue(AutomationElement.ControlTypeProperty)
as ControlType;
Dim controlTypeId As ControlType = _
DirectCast(autoElement.GetCurrentPropertyValue(AutomationElement.ControlTypeProperty), ControlType)
O exemplo seguinte recupera o valor atual da propriedade, mas especifica que, se o próprio elemento não fornecer um valor para a propriedade, NotSupported deve ser devolvido em vez de um valor padrão.
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
Observações
Este identificador é utilizado por aplicações clientes de Automatização da Interface de Utilizador. Automatização da Interface de Utilizador fornecedores devem usar o identificador equivalente em AutomationElementIdentifiers.
Esta propriedade também pode ser recuperada das Current propriedades ou.Cached
O valor padrão da propriedade é Custom