PasswordBox.Paste Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Hiermee vervangt u de huidige selectie in de PasswordBox selectie door de inhoud van het Klembord.
public:
void Paste();
public void Paste();
member this.Paste : unit -> unit
Public Sub Paste ()
Voorbeelden
In het volgende voorbeeld ziet u hoe u inhoud in een PasswordBox met de Paste methode plakt.
// A TextBox will serve as a contrived means of putting our test
// password on the Clipboard.
TextBox txtBox = new TextBox();
PasswordBox pwdBox = new PasswordBox();
// Put some content in the TextBox, and copy it to the Clipboard.
txtBox.Text = "Open Sesame!";
txtBox.SelectAll();
txtBox.Copy();
// Paste the contents of the Clipboard into the PasswordBox. After this
// call, the value of pwdBox.Password == "Open Sesame!".
pwdBox.Paste();
' A TextBox will serve as a contrived means of putting our test
' password on the Clipboard.
Dim txtBox As New TextBox()
Dim pwdBox As New PasswordBox()
' Put some content in the TextBox, and copy it to the Clipboard.
txtBox.Text = "Open Sesame!"
txtBox.SelectAll()
txtBox.Copy()
' Paste the contents of the Clipboard into the PasswordBox. After this
' call, the value of pwdBox.Password == "Open Sesame!".
pwdBox.Paste()
Opmerkingen
Met deze methode wordt de inhoud van de voor het PasswordBox plakken niet gewist. De huidige selectie wordt vervangen door geplakte inhoud of de geplakte inhoud op de huidige cursorpositie ingevoegd.