DataFormats::Format Class

 

Represents a Clipboard format type.

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

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

public ref class Format 

NameDescription
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.

NameDescription
System_CAPS_pubpropertyId

Gets the ID number for this format.

System_CAPS_pubpropertyName

Gets the name of this format.

NameDescription
System_CAPS_pubmethodEquals(Object^)

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

System_CAPS_protmethodFinalize()

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

System_CAPS_pubmethodGetHashCode()

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

System_CAPS_pubmethodGetType()

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

System_CAPS_protmethodMemberwiseClone()

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

System_CAPS_pubmethodToString()

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