Bagikan melalui


PasswordBox.PasswordChanged Kejadian

Definisi

Terjadi ketika nilai Password properti berubah.

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

Jenis Acara

Contoh

Contoh berikut menunjukkan cara menentukan metode handler untuk peristiwa tersebut PasswordChanged .

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

Contoh berikut menunjukkan penanganan aktivitas yang sesuai. Dalam hal ini, penanganan aktivitas hanya menaikkan penghitung.

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

Keterangan

Informasi Peristiwa Yang Dirutekan

Bidang pengidentifikasi PasswordChangedEvent
Strategi perutean Menggelegak
Delegasikan RoutedEventHandler

Berlaku untuk