- format
The format of the data to set. See System.Windows.Forms.DataFormats for predefined formats.
- data
An object representing the data to add.
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 Clipboard.ContainsData(string) method to determine whether the Clipboard contains data in that format before retrieving it with the Clipboard.GetData(string) method.
The System.Windows.Forms.Clipboard class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your Main method is marked with the STAThreadAttribute attribute.