PasswordBox.PasswordChanged Evento

Definizione

Si verifica quando il valore della proprietà Password cambia.

public:
 event System::Windows::RoutedEventHandler ^ PasswordChanged;
public event System.Windows.RoutedEventHandler PasswordChanged;
member this.PasswordChanged : System.Windows.RoutedEventHandler 
Public Custom Event PasswordChanged As RoutedEventHandler 

Tipo evento

Esempio

Nell'esempio seguente viene illustrato come specificare il metodo del gestore per l'evento PasswordChanged .

<PasswordBox
  Name="pwdBox" 
  MaxLength="64"
  PasswordChar="#"
  PasswordChanged="PasswordChangedHandler"  
/>

Nell'esempio seguente viene illustrato il gestore eventi corrispondente. In questo caso, il gestore eventi incrementa semplicemente un contatore.

private int pwChanges = 0;

void PasswordChangedHandler(Object sender, RoutedEventArgs args)
{
    // Increment a counter each time the event fires.
    ++pwChanges;
}
Private pwChanges As Integer = 0

Private Sub PasswordChangedHandler(ByVal sender As Object, ByVal args As RoutedEventArgs)
    ' Increment a counter each time the event fires.
    pwChanges += 1
End Sub

Commenti

Informazioni evento indirizzato

Campo Identificatore PasswordChangedEvent
Strategia di routing Bubbling
Delegato RoutedEventHandler

Si applica a