Clipboard.SetData Method (String, Object)
Clears the Clipboard and then adds data in the specified format.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process.
The current thread is not in single-threaded apartment (STA) mode. Add the STAThreadAttribute to your application's Main method.
data is null.
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.
To retrieve data from the Clipboard in a particular format, first use the ContainsData method to determine whether the Clipboard contains data in that format before retrieving it with the GetData method.
The following example demonstrates this member.
for adding data to the system Clipboard that is of type String or is in one of the following data formats: Text, UnicodeText, or CommaSeparatedValue. Associated enumeration: UIPermissionClipboard.OwnClipboard
for adding data of any type or format to the system Clipboard. Associated enumeration: UIPermissionClipboard.AllClipboard
Available since 2.0