Bewerken

Delen via


PasswordBox.PasswordChanged Event

Definition

Occurs when the value of the Password property changes.

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

Event Type

Examples

The following example shows how to specify the handler method for the PasswordChanged event.

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

The following example shows the corresponding event handler. In this case, the event handler simply increments a counter.

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

Remarks

Routed Event Information

Identifier field PasswordChangedEvent
Routing strategy Bubbling
Delegate RoutedEventHandler

Applies to