DataFormats.Format Class
Assembly: System.Windows.Forms (in system.windows.forms.dll)
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 Sub GetMyFormatInfomation() ' Creates a DataFormats.Format for the Unicode data format. Dim myFormat As DataFormats.Format = _ DataFormats.GetFormat(DataFormats.UnicodeText) ' Displays the contents of myFormat. textBox1.Text = "ID value: " + myFormat.Id.ToString() + ControlChars.Cr _ + "Format name: " + myFormat.Name End Sub
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
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.