ValuePattern.IsReadOnlyProperty Campo

Definição

Identifica a propriedade IsReadOnly.

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

Valor do campo

Exemplos

No exemplo a seguir, um elemento raiz é passado para uma função que retorna uma coleção de elementos de automação da interface do usuário descendentes da raiz e atendem a um conjunto de condições de propriedade.

///--------------------------------------------------------------------
/// <summary>
/// Finds all automation elements that satisfy 
/// the specified condition(s).
/// </summary>
/// <param name="targetApp">
/// The automation element from which to start searching.
/// </param>
/// <returns>
/// A collection of automation elements satisfying 
/// the specified condition(s).
/// </returns>
///--------------------------------------------------------------------
private AutomationElementCollection FindAutomationElement(
    AutomationElement targetApp)
{
    if (targetApp == null)
    {
        throw new ArgumentException("Root element cannot be null.");
    }

    PropertyCondition conditionIsReadOnly =
        new PropertyCondition(
        ValuePattern.IsReadOnlyProperty, false);

    return targetApp.FindAll(
        TreeScope.Descendants, conditionIsReadOnly);
}
'''--------------------------------------------------------------------
''' <summary>
''' Finds all automation elements that satisfy 
''' the specified condition(s).
''' </summary>
''' <param name="targetApp">
''' The automation element from which to start searching.
''' </param>
''' <returns>
''' A collection of automation elements satisfying 
''' the specified condition(s).
''' </returns>
'''--------------------------------------------------------------------
Private Function FindAutomationElement( _
ByVal targetApp As AutomationElement) As AutomationElementCollection
    If targetApp Is Nothing Then
        Throw New ArgumentException("Root element cannot be null.")
    End If

    Dim conditionIsReadOnly As New PropertyCondition( _
    ValuePattern.IsReadOnlyProperty, False)

    Return targetApp.FindAll(TreeScope.Descendants, conditionIsReadOnly)

End Function 'FindAutomationElement

Comentários

Esse identificador é usado por aplicativos cliente da Automação da Interface do Usuário. Os provedores de Automação da Interface do Usuário devem usar o campo equivalente em ValuePatternIdentifiers.

Um controle deve ter seu IsEnabledProperty definido true como e seu IsReadOnlyProperty definido false como antes que um cliente tente uma chamada para SetValue.

Aplica-se a

Confira também