Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

PasswordBox.PasswordChanged Event

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Occurs when the value of the Password property changes.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public event RoutedEventHandler PasswordChanged

Identifier field

PasswordChangedEvent

Routing strategy

Bubbling

Delegate

RoutedEventHandler

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;
}

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2017 Microsoft