ClipboardProxy.GetDataObject Method


Retrieves data from the Clipboard as an IDataObject.

 System::Windows::Forms::IDataObject ^ GetDataObject();
public System.Windows.Forms.IDataObject GetDataObject ();
member this.GetDataObject : unit -> System.Windows.Forms.IDataObject
Public Function GetDataObject () As IDataObject


An IDataObject object that represents the data currently on the Clipboard, or Nothing if there is no data on the Clipboard.


This example reads data from the Clipboard in the form of an IDataObject and then writes it to a file.

Dim someData As Object
someData = My.Computer.Clipboard.GetDataObject()
My.Computer.FileSystem.WriteAllBytes("C:\mylogfile", someData, True)

Replace C:\mylogfile with the name of the file to which you want to write.


This is an advanced member; it does not show in IntelliSense unless you click the All tab.

Availability by Project Type

Project type Available
Windows Application Yes
Class Library Yes
Console Application Yes
Windows Control Library Yes
Web Control Library No
Windows Service Yes
Web Site No


AllClipboard permission is required to access the system Clipboard.

Applies to

See also