PasswordBox.Clear Metod

Definition

Rensar värdet för Password egenskapen.

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

Exempel

I följande exempel visas hur du rensar en PasswordBox med Clear -metoden.

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

Kommentarer

Värdet för egenskapen Password är Empty efter ett anrop till den här metoden.

Gäller för