DataObject Constructor (Object^)
.NET Framework (current version)
Initializes a new instance of the DataObject class and adds the specified object to it.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Parameters
- data
-
Type:
System::Object^
The data to store.
You can add data in any format to the DataObject when you use this constructor, or you can add data as an IDataObject to provide multiple formats at once. If you are familiar with COM programming, you can also add a data object that implements the COM IDataObject interface. For more information, see IDataObject in the MSDN library at http://msdn.microsoft.com/library.
The following code example creates a DataObject that contains a string. The data is retrieved using its data format. The results are displayed in a text box. This code requires that textBox1 has been created.
.NET Framework
Available since 1.1
Available since 1.1
Show: