System.Windows.Forms.DataObject.SetData Method

Adds the specified object to the System.Windows.Forms.DataObject using the object type as the data format.

Syntax

public virtual void SetData (object data)

Parameters

data
The data to store.

Remarks

If you do not know the format of the target application, you can store data in multiple formats using this method. Data stored using this method can be converted to a compatible format when it is retrieved.

The DataObject.SetData(object) overload stores the data value in a format that it determines by calling the object.GetType method. If data implements the System.Runtime.Serialization.ISerializable interface, this overload also stores the value in the System.Windows.DataFormats.Serializable format.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0