This documentation is archived and is not being maintained.

DataFormats.Format Class

Represents a Clipboard format type.

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

public class Format

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;


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

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0