DataFormats.Format 类  
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
表示剪贴板格式类型。
public: ref class DataFormats::Formatpublic class DataFormats.Formattype DataFormats.Format = classPublic Class DataFormats.Format- 继承
- 
				DataFormats.Format
示例
下面的代码示例演示如何检索 DataFormats.Format 表示格式名称/ID 对的 。 请求 UnicodeText 格式,检索到的内容 DataFormats.Format 显示在文本框中。
此代码要求 textBox1 已创建 。
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 号组成。 格式名称/ID 编号对可以定义系统 Clipboard 或其他格式。
构造函数
| DataFormats.Format(String, Int32) | 用一个布尔值对 DataFormats.Format 类的新实例进行初始化,此布尔值指示是否需要  | 
属性
| Id | 获取此格式的 ID 号。 | 
| Name | 获取该格式的名称。 | 
方法
| Equals(Object) | 确定指定对象是否等于当前对象。(继承自 Object) | 
| GetHashCode() | 作为默认哈希函数。(继承自 Object) | 
| GetType() | 获取当前实例的 Type。(继承自 Object) | 
| MemberwiseClone() | 创建当前 Object 的浅表副本。(继承自 Object) | 
| ToString() | 返回表示当前对象的字符串。(继承自 Object) |