System.Windows.Forms 1.0.5000.0 2.0.0.0 System.Object For a list of predefined formats to use with the class, see the class. Call to put data on the Clipboard, replacing its current contents. To place a persistent copy of the data on the Clipboard, set the parameter to true. To place data on the Clipboard in multiple formats, use the class or an implementation. Place data on the Clipboard in multiple formats to maximize the possibility that a target application, whose format requirements you might not know, can successfully retrieve the data. Call to retrieve data from the Clipboard. The data is returned as an object that implements the interface. Use the methods specified by and fields in to extract the data from the object. If you do not know the format of the data you retrieved, call the method of the interface to get a list of all formats that data is stored in. Then call the method of the interface, and specify a format that your application can use. In dnprdnext, the class provides additional methods that make it easier to work with the system Clipboard. Call the method to remove all data from the Clipboard. To add data of a particular format to the Clipboard, replacing the existing data, call the appropriate SetFormat method, such as , or call the method to specify the format. To retrieve data of a particular format from the Clipboard, first call the appropriate ContainsFormat method (such as ) method to determine whether the Clipboard contains data in that format, and then call the appropriate GetFormat method (such as ) to retrieve the data if the Clipboard contains it. To specify the format in these operations, call the and methods instead. All Windows-based applications share the system Clipboard, so the contents are subject to change when you switch to another application. An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to a Clipboard method, the method will fail without throwing an exception. See for more information on serialization. If your target application requires a very specific data format, the headers added to the data in the serialization process may prevent the application from recognizing your data. To preserve your data format, add your data as a array to a and pass the to the method. The 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 attribute. Special considerations may be necessary when using the metafile format with the Clipboard. Due to a limitation in the current implementation of the class, the metafile format used by the .NET Framework may not be recognized by applications that use an older metafile format. In this case, you must interoperate with the Win32 Clipboard application programming interfaces (APIs). For more information, see article 323530, "Metafiles on Clipboard Are Not Visible to All Applications," in the Microsoft Knowledge Base at http://support.microsoft.com. Provides methods to place data on and retrieve data from the system Clipboard. This class cannot be inherited. Method 2.0.0.0 System.Void Because the Clipboard is shared by multiple processes, calling this method may have an impact on those processes. The 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 attribute. Removes all data from the Clipboard. Method 2.0.0.0 System.Boolean Use this method to determine whether the Clipboard contains audio data before retrieving it with the method. The 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 attribute. Indicates whether there is data on the Clipboard in the format. true if there is audio data on the Clipboard; otherwise, false. Method 2.0.0.0 System.Boolean The class contains pre-defined format names that you can use with this method. Use this method to determine whether the Clipboard contains data in the specified format or a compatible format before retrieving it with the method. Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text. The 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 attribute. Indicates whether there is data on the Clipboard that is in the specified format or can be converted to that format. true if there is data on the Clipboard that is in the specified or can be converted to that format; otherwise, false. The format of the data to look for. See for predefined formats. Method 2.0.0.0 System.Boolean A file drop list is a collection of strings containing path information for files. Use this method to determine whether the Clipboard contains a file drop list before retrieving it with the method. The 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 attribute. Indicates whether there is data on the Clipboard that is in the format or can be converted to that format. true if there is a file drop list on the Clipboard; otherwise, false. Method 2.0.0.0 System.Boolean Use this method to determine whether the Clipboard contains image data before retrieving it with the method. The 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 attribute. Indicates whether there is data on the Clipboard that is in the format or can be converted to that format. true if there is image data on the Clipboard; otherwise, false. Method 2.0.0.0 System.Boolean This method checks for the presence of data in the format on WinXpFamily and Win2kFamily. Otherwise, this method checks for the presence of data in the format. Use this method to determine whether the Clipboard contains text data before retrieving it with the method. The 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 attribute. Indicates whether there is data on the Clipboard in the or format, depending on the operating system. true if there is text data on the Clipboard; otherwise, false. Method 2.0.0.0 System.Boolean Use this method to determine whether the Clipboard contains text data before retrieving it with the method. The 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 attribute. Indicates whether there is text data on the Clipboard in the format indicated by the specified value. true if there is text data on the Clipboard in the value specified for ; otherwise, false. One of the values. Method 2.0.0.0 System.IO.Stream Use the method to determine whether the Clipboard contains audio data before retrieving it with this method. Use the method to add audio data to the Clipboard. The 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 attribute. Retrieves an audio stream from the Clipboard. A containing audio data or null if the Clipboard does not contain any data in the format. Method 2.0.0.0 System.Object Use the method to determine whether the Clipboard contains data in the specified format or a compatible format before retrieving it with this method. If this method cannot find data in the specified format, it attempts to convert the data to the format. If the data cannot be converted to the specified format, or if the data was stored with automatic conversion set to false, this method returns null. Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text. The 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 attribute. Use the method to add data to the Clipboard in a particular format. Retrieves data from the Clipboard in the specified format. An representing the Clipboard data or null if the Clipboard does not contain any data that is in the specified or can be converted to that format. The format of the data to retrieve. See for predefined formats. Method System.Windows.Forms.IDataObject Because the data type of the object returned from the Clipboard can vary, this method returns the data in an . Then you can use methods of the interface to extract the data in its proper data type. This method attempts to get the data ten times in 100-millisecond intervals, and throws an if all attempts are unsuccessful. The 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 attribute. Retrieves the data that is currently on the system Clipboard. An that represents the data currently on the Clipboard, or null if there is no data on the Clipboard. 1.0.5000.0 2.0.0.0 Method 2.0.0.0 System.Collections.Specialized.StringCollection A file drop list is a collection of strings containing path information for files. A file drop list is stored on the Clipboard as a array. This method converts this array to a and returns the collection. Use the method to determine whether the Clipboard contains a file drop list before retrieving it with this method. Use the method to add a file drop list to the Clipboard. The 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 attribute. Retrieves a collection of file names from the Clipboard. A containing file names or null if the Clipboard does not contain any data that is in the format or can be converted to that format. Method 2.0.0.0 System.Drawing.Image Use the method to determine whether the Clipboard contains image data before retrieving it with this method. Use the method to add image data to the Clipboard. The 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 attribute. Retrieves an image from the Clipboard. An representing the Clipboard image data or null if the Clipboard does not contain any data that is in the format or can be converted to that format. Method 2.0.0.0 System.String This method returns text data in the format on WinXpFamily and Win2kFamily. Otherwise, this method returns text data in the format. Use the method to determine whether the Clipboard contains text data before retrieving it with this method. Use the method to add text data to the Clipboard. The 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 attribute. Retrieves text data from the Clipboard in the or format, depending on the operating system. The Clipboard text data or if the Clipboard does not contain data in the or format, depending on the operating system. Method 2.0.0.0 System.String Use the method to determine whether the Clipboard contains text data before retrieving it with this method. Use the method to add text data to the Clipboard. The 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 attribute. Retrieves text data from the Clipboard in the format indicated by the specified value. The Clipboard text data or if the Clipboard does not contain data in the specified format. One of the values. Method 2.0.0.0 System.Void To retrieve audio data from the Clipboard, first use the method to determine whether the Clipboard contains audio data before retrieving it with the method. The 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 attribute. Clears the Clipboard and then adds a array in the format after converting it to a . A array containing the audio data. Method 2.0.0.0 System.Void To retrieve audio data from the Clipboard, first use the method to determine whether the Clipboard contains audio data before retrieving it with the method. The 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 attribute. Clears the Clipboard and then adds a in the format. A containing the audio data. Method 2.0.0.0 System.Void 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 method to determine whether the Clipboard contains data in that format before retrieving it with the method. The 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 attribute. Clears the Clipboard and then adds data in the specified format. The format of the data to set. See for predefined formats. An representing the data to add. Method System.Void Data will be deleted from system Clipboard when the application exits. This method attempts to set the data ten times in 100-millisecond intervals, and throws an if all attempts are unsuccessful. An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See for more information on serialization. The 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 attribute. Clears the Clipboard and then places nonpersistent data on it. The data to place on the Clipboard. 1.0.5000.0 2.0.0.0 Method System.Void If the parameter is false, the data will be deleted from system Clipboard when the application exits. This method attempts to set the data ten times in 100-millisecond intervals, and throws an if all attempts are unsuccessful. An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See for more information on serialization. The 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 attribute. Clears the Clipboard and then places data on it and specifies whether the data should remain after the application exits. The data to place on the Clipboard. true if you want data to remain on the Clipboard after this application exits; otherwise, false. 1.0.5000.0 2.0.0.0 Method 2.0.0.0 System.Void Adding data to the Clipboard can occasionally fail if the Clipboard is busy with another thread or application. This method is useful to work around this issue in environments with heavy Clipboard use. If the parameter is false, the data will be deleted from system Clipboard when the application exits. An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See for more information on serialization. The 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 attribute. Clears the Clipboard and then attempts to place data on it the specified number of times and with the specified delay between attempts, optionally leaving the data on the Clipboard after the application exits. The data to place on the Clipboard. true if you want data to remain on the Clipboard after this application exits; otherwise, false. The number of times to attempt placing the data on the Clipboard. The number of milliseconds to pause between attempts. Method 2.0.0.0 System.Void A file drop list is a collection of strings containing path information for files. A file drop list is stored on the Clipboard as a array. This method converts to a array before adding it to the Clipboard. To retrieve a file drop list from the Clipboard, first use the method to determine whether the Clipboard contains data in that format before retrieving it with the method. The 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 attribute. Clears the Clipboard and then adds a collection of file names in the format. A containing the file names. Method 2.0.0.0 System.Void To retrieve image data from the Clipboard, first use the method to determine whether the Clipboard contains image data before retrieving it with the method. The 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 attribute. Clears the Clipboard and then adds an in the format. The to add to the Clipboard. Method 2.0.0.0 System.Void This method adds text data in the format on WinXpFamily and Win2kFamily. Otherwise, this method adds text data in the format. To retrieve text data from the Clipboard, first use the method to determine whether the Clipboard contains text data before retrieving it with the method. The 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 attribute. Clears the Clipboard and then adds text data in the or format, depending on the operating system. The text to add to the Clipboard. Method 2.0.0.0 System.Void To retrieve text data from the Clipboard, first use the method to determine whether the Clipboard contains text data before retrieving it with the method. The 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 attribute. Clears the Clipboard and then adds text data in the format indicated by the specified value. The text to add to the Clipboard. One of the values.