PasswordBox.Clear Method ()


Clears the value of the Password property.

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

Public Sub 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.

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.

.NET Framework
Available since 3.0
Return to top