DataFormats.Format Class
Collapse the table of content
Expand the table of content

DataFormats.Format Class


Represents a Clipboard format type.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)


public class Format

System_CAPS_pubmethodDataFormats.Format(String, Int32)

This API supports the product infrastructure and is not intended to be used directly from your code. Initializes a new instance of the DataFormats.Format class with a Boolean that indicates whether a Win32 handle is expected.


Gets the ID number for this format.


Gets the name of this format.


Determines whether the specified object is equal to the current object.(Inherited from Object.)


Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)


Serves as the default hash function. (Inherited from Object.)


Gets the Type of the current instance.(Inherited from Object.)


Creates a shallow copy of the current Object.(Inherited from Object.)


Returns a string that represents the current object.(Inherited from Object.)

A format type consists of a text-based format name and an ID number. The format name/ID number pair can define a system Clipboard or other format.

The following code example shows how to retrieve a DataFormats.Format representing a format name/ID pair. The UnicodeText format is requested, and the contents of the retrieved DataFormats.Format are displayed in a text box.

This code requires that textBox1 has been created.

private void GetMyFormatInfomation() {
   // Creates a DataFormats.Format for the Unicode data format.
   DataFormats.Format myFormat = DataFormats.GetFormat(DataFormats.UnicodeText);

   // Displays the contents of myFormat.
   textBox1.Text = "ID value: " + myFormat.Id + '\n' +
      "Format name: " + myFormat.Name;

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
© 2015 Microsoft