Редагувати

Поділитися через


DataFormats.Format Class

Definition

Represents a Clipboard format type.

public: ref class DataFormats::Format
public class DataFormats.Format
type DataFormats.Format = class
Public Class DataFormats.Format
Inheritance
DataFormats.Format

Examples

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 );
   }
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 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

Remarks

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.

Constructors

DataFormats.Format(String, Int32)

Initializes a new instance of the DataFormats.Format class with a Boolean that indicates whether a Win32 handle is expected.

Properties

Id

Gets the ID number for this format.

Name

Gets the name of this format.

Methods

Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
ToString()

Returns a string that represents the current object.

(Inherited from Object)

Applies to

See also