次の方法で共有


PasswordBox.Clear メソッド

定義

Password プロパティの値をクリアします。

public:
 void Clear();
public void Clear();
member this.Clear : unit -> unit
Public Sub Clear ()

次の例は、Clear メソッドを使用してPasswordBoxをクリアする方法を示しています。

PasswordBox pwdBox = new PasswordBox();
pwdBox.Password = "Open Sesame!";

// Clear any contents of the PasswordBox, as well as the value stored in the Password property.
pwdBox.Clear();
Dim pwdBox As New PasswordBox()
pwdBox.Password = "Open Sesame!"

' Clear any contents of the PasswordBox, as well as the value stored in the Password property.
pwdBox.Clear()

注釈

Password プロパティの値は、このメソッドの呼び出し後にEmptyされます。

適用対象