Clipboard.ContentChanged Clipboard.ContentChanged Clipboard.ContentChanged Clipboard.ContentChanged Clipboard.ContentChanged Event


Occurs when the data stored in the Clipboard changes.

public : event EventHandler<Platform::Object> ContentChanged
// Register
event_token ContentChanged(EventHandler<Platform::Object> const& handler) const;

// Revoke with event_token
void ContentChanged(event_token const& cookie) const;

// Revoke with event_revoker
ContentChanged_revoker ContentChanged(auto_revoke_t, EventHandler<Platform::Object> const& handler) const;
public event EventHandler<object> ContentChanged
Public Event ContentChanged As EventHandler (Of object)
function onContentChanged(eventArgs){/* Your code */}

clipboard.addEventListener("contentchanged", onContentChanged);
clipboard.removeEventListener("contentchanged", onContentChanged);


The following example shows how to track changes to the Clipboard. The first code snippet registers a handler for the ContentChanged event. The second code snippet shows the event handler, which enables the app's paste command if the Clipboard contains a bitmap.

function RegisterEvents() {

    // Register a listener for the ContentChanged event. It is called whenever 
    // the clipboard content changes
        "contentchanged", onClipboardContentChanged); 

// TODO: Register other event listeners here.

function onClipboardContentChanged(e) {
    var dataPackageView = Windows.ApplicationModel.DataTransfer.Clipboard.getContent();
    if (dataPackageView.contains(Windows.ApplicationModel.DataTransfer.StandardDataFormats.bitmap)) {
        // TODO: Enable the Paste command.



This event is helpful in situations when your app contains logic that varies depending on the contents on the clipboard. For example, your app might include a Paste button, which is disabled unless the Clipboard contains content.