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!

Clipboard.SetDataObject

Places data on the system Clipboard.

Overload List

Places nonpersistent data on the system Clipboard.

[Visual Basic] Overloads Public Shared Sub SetDataObject(Object)
[C#] public static void SetDataObject(Object);
[C++] public: static void SetDataObject(Object*);
[JScript] public static function SetDataObject(Object);

Places data on the system Clipboard. using copy to specify whether the data should remain on the Clipboard after the application exits.

[Visual Basic] Overloads Public Shared Sub SetDataObject(Object, Boolean)
[C#] public static void SetDataObject(Object, bool);
[C++] public: static void SetDataObject(Object*, bool);
[JScript] public static function SetDataObject(Object, Boolean);

Example [Visual Basic]

The following example places a persistent copy of the selected text data in the text box on the system Clipboard. This code assumes Button3 and TextBox1 have been instantiated.

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

[Visual Basic]

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
   'Take the selected text from a text box and put it on the clipboard.
   Clipboard.SetDataObject(TextBox1.SelectedText, True)
End Sub

See Also

Clipboard Class | Clipboard Members | System.WinForms Namespace