Clipboard Class
Collapse the table of content
Expand the table of content

Clipboard Class

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Provides static methods that facilitate transferring data to the system clipboard. This access is limited to Unicode text strings.


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

public static class Clipboard

The Clipboard type exposes the following members.

Public methodStatic memberContainsTextQueries the clipboard for the presence of data in the UnicodeText format.
Public methodStatic memberGetTextInfrastructure. This method is not supported on Windows Phone. Calling this method will cause a SecurityException to occur.
Public methodStatic memberSetTextSets Unicode text data to store on the clipboard, for later access with GetText.

Access to clipboard information is limited to Unicode text access. This differs from the WPF implementation of Clipboard, which enables access to other specific types (for example, streams or images) or to data objects. Also, on Windows Phone, applications can only write text to the clipboard. Attempting to read text from the clipboard will cause a SecurityException to be thrown.

Windows Phone also supports a related drag-and-drop scenario in which a UIElement can be a drop target for a data payload that communicates a file list. However, this scenario does not directly involve the Clipboard class, and uses specific event data. For more information, see AllowDrop.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1

Windows Phone

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

© 2017 Microsoft