Clipboard.GetDataObject Method ()

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Returns a data object that represents the entire contents of the Clipboard.

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

[SecurityCriticalAttribute]
public static IDataObject GetDataObject()

Return Value

Type: System.Windows.IDataObject

A data object that enables access to the entire contents of the system Clipboard, or null if there is no data on the Clipboard.

Access to data on the system Clipboard is enabled through a data object, that is, an object that implements the IDataObject interface. A list of predefined formats is defined by the DataFormats class. Use the methods specified by IDataObject and fields in DataFormats to examine and extract the data from the data object.

To examine the formats of data on the system Clipboard, call GetFormats on the data object returned by this method. To retrieve data from the system Clipboard, call GetData and specify the desired data format.

The system Clipboard is shared by all applications, so data on the Clipboard is subject to change by other applications.

UIPermission

for permission to access data on the system Clipboard. Associated enumeration: AllClipboard.

.NET Framework
Available since 3.0
Return to top
Show: