共用方式為


PasswordBox.Clear 方法

定義

清除 Password 屬性的值。

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

範例

下列範例示範如何使用 方法清除 PasswordBoxClear

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 呼叫這個方法之後。

適用於