Bagikan melalui


PasswordBox.Clear Metode

Definisi

Menghapus nilai Password properti .

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

Contoh

Contoh berikut menunjukkan cara menghapus PasswordBox dengan Clear metode .

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()

Keterangan

Nilai Password properti adalah Empty setelah panggilan ke metode ini.

Berlaku untuk