Retrieves text data from the Clipboard in the format indicated by the specified System.Windows.Forms.TextDataFormat value.
- format
- One of the System.Windows.Forms.TextDataFormat values.
The Clipboard text data or string.Empty if the Clipboard does not contain data in the specified format.
Use the erload:System.Windows.Forms.Clipboard.ContainsText method to determine whether the Clipboard contains text data before retrieving it with this method.
Use the erload:System.Windows.Forms.Clipboard.SetText method to add text data to the Clipboard.
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.