Clear Method

PasswordBox.Clear Method ()


Clears the value of the Password property.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public void Clear()

The value of the Password property is Empty after a call to this method.

The following example shows how to clear a PasswordBox with the Clear method.

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

// Clear any contents of the PasswordBox, as well as the value stored in the Password property.

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft