DataFormats.Format 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
代表剪貼板格式類型。
public: ref class DataFormats::Format
public class DataFormats.Format
type DataFormats.Format = class
Public 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 或其他格式。
建構函式
| 名稱 | Description |
|---|---|
| DataFormats.Format(String, Int32) |
初始化一個新的類別實例 DataFormats.Format ,並使用布林值表示是否預期有 |
屬性
| 名稱 | Description |
|---|---|
| Id |
會取得此格式的 ID 編號。 |
| Name |
這就是這個格式的名稱。 |
方法
| 名稱 | Description |
|---|---|
| Equals(Object) |
判斷指定的物件是否等於目前的物件。 (繼承來源 Object) |
| GetHashCode() |
做為預設哈希函式。 (繼承來源 Object) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |