Export (0) Print
Expand All

DataFormats.Format Class

Represents a Clipboard format type.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

public class Format
public class Format
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;
}


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.set_Text("ID value: "
        + myFormat.get_Id() + '\n' + "Format name: " + myFormat.get_Name());
} //GetMyFormatInfomation

System.Object
  System.Windows.Forms.DataFormats.Format

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 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

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

.NET Framework

Supported in: 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft