NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DataFormats.GetFormat

Gets a DataFormats.Format with the Windows Clipboard numeric ID and name.

Overload List

Gets a DataFormats.Format with the Windows Clipboard numeric ID and name for the specified id.

[Visual Basic] Overloads Public Shared Function GetFormat(Integer) As Format
[C#] public static Format GetFormat(int);
[C++] public: static Format* GetFormat(int);
[JScript] public static function GetFormat(int) : Format;

Gets a DataFormats.Format with the Windows Clipboard numeric ID and name for the specified format.

[Visual Basic] Overloads Public Shared Function GetFormat(String) As Format
[C#] public static Format GetFormat(String);
[C++] public: static Format* GetFormat(String*);
[JScript] public static function GetFormat(String) : Format;

Example [Visual Basic]

The following 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 object are displayed in a MessageBox. This code assumes Button1 has been instantiated.

Note   This example shows how to use one of the overloaded versions of GetFormat. For other examples that may be available, see the individual overload topics.

[Visual Basic]

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
   ' Get a DataFormat.Format for unicode data format.
   Dim formatObj1 As DataFormats.Format
   Set formatObj1 = DataFormats.GetFormat(DataFormats.UnicodeText)

   ' Display contents of the DataFormats.Format.
   messagebox.Show "Id value: " & formatobj1.id & vbnewline & _
      "Format name: " & formatobj1.name & vbnewline & _
      "Windows handle needed?: " & formatObj1.win32Handle
End Sub

See Also

DataFormats Class | DataFormats Members | System.WinForms Namespace