DataFormats.Format 类

定义

表示剪贴板格式类型。Represents a Clipboard format type.

public: ref class DataFormats::Format
public class DataFormats.Format
type DataFormats.Format = class
Public Class DataFormats.Format
继承
DataFormats.Format

示例

下面的代码示例演示如何检索表示格式DataFormats.Format名称/ID 对的。The following code example shows how to retrieve a DataFormats.Format representing a format name/ID pair. 请求格式, 检索DataFormats.Format的内容将显示在文本框中。 UnicodeTextThe UnicodeText format is requested, and the contents of the retrieved DataFormats.Format are displayed in a text box.

此代码需要已textBox1创建的。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

注解

格式类型包括基于文本的格式名和 ID 号。A format type consists of a text-based format name and an ID number. 格式名称/ID 号对可以定义系统Clipboard或其他格式。The format name/ID number pair can define a system Clipboard or other format.

构造函数

DataFormats.Format(String, Int32)

用一个布尔值对 DataFormats.Format 类的新实例进行初始化,此布尔值指示是否需要 Win32 句柄。Initializes a new instance of the DataFormats.Format class with a Boolean that indicates whether a Win32 handle is expected.

属性

Id

获取此格式的 ID 号。Gets the ID number for this format.

Name

获取该格式的名称。Gets the name of this format.

方法

Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(继承自 Object)
GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(继承自 Object)
GetType()

获取当前实例的 TypeGets the Type of the current instance.

(继承自 Object)
MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(继承自 Object)
ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(继承自 Object)

适用于

另请参阅