語言

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

備註

路由事件資訊

Item 價值觀
識別碼欄位 PasswordChangedEvent
路由策略 氣泡
代理人 RoutedEventHandler

適用於