Freigeben über


DataFormats.Format-Klasse

Stellt einen Formattyp für die Zwischenablage dar.

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

Syntax

'Declaration
Public Class Format
'Usage
Dim instance As Format
public class Format
public ref class Format
public class Format
public class Format

Hinweise

Ein Formattyp besteht aus einem textbasierten Formatnamen und einer ID-Nummer. Das Formatname/ID-Paar kann ein Format der System-Clipboard oder ein anderes Format definieren.

Beispiel

Im folgenden Codebeispiel wird veranschaulicht, wie ein DataFormats.Format abgerufen wird, das ein Formatname-ID-Paar darstellt. Das UnicodeText-Format wird angefordert, und der Inhalt des abgerufenen DataFormats.Format-Objekts wird in einem Textfeld angezeigt.

Für diesen Code muss textBox1 erstellt worden sein.

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.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->Text = String::Format( "ID value: {0}\nFormat name: {1}",
         myFormat->Id, 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

Vererbungshierarchie

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

Threadsicherheit

Alle öffentlichen statischen (Shared in Visual Basic) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Plattformen

Windows 98, Windows 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile für Pocket PC, Windows Mobile für Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

DataFormats.Format-Member
System.Windows.Forms-Namespace
Clipboard-Klasse
DataFormats-Klasse
DataObject
IDataObject