Udostępnij za pośrednictwem


PasswordBox.Paste Event

Definition

Occurs when text is pasted into the control.

public:
 virtual event TextControlPasteEventHandler ^ Paste;
// Register
event_token Paste(TextControlPasteEventHandler const& handler) const;

// Revoke with event_token
void Paste(event_token const* cookie) const;

// Revoke with event_revoker
PasswordBox::Paste_revoker Paste(auto_revoke_t, TextControlPasteEventHandler const& handler) const;
public event TextControlPasteEventHandler Paste;
function onPaste(eventArgs) { /* Your code */ }
passwordBox.addEventListener("paste", onPaste);
passwordBox.removeEventListener("paste", onPaste);
- or -
passwordBox.onpaste = onPaste;
Public Custom Event Paste As TextControlPasteEventHandler 
<PasswordBox Paste="eventhandler"/>

Event Type

Remarks

The Paste event occurs before any content is inserted into the control. You can handle this event to check the contents of the clipboard and perform any actions on the content before it's inserted. If you perform any action, set the handled property to true; otherwise, the default paste action is performed. If you set the handled property to true, then it's assumed the app has handled the insertion, and no default action is performed. You are responsible for determining the insertion point and clipboard content to insert, and inserting the content.

Applies to