PasswordBox.PasswordChanged 事件

定义

Password 属性的值更改时发生。

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

事件类型

示例

以下示例演示如何为 PasswordChanged 事件指定处理程序方法。

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

以下示例显示了相应的事件处理程序。 在这种情况下,事件处理程序只是递增计数器。

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

注解

路由事件信息

标识符字段 PasswordChangedEvent
路由策略 鼓 泡
委托 RoutedEventHandler

适用于