SetDataObject Method


SetDataObject Method

Location

My.Computer.Clipboard.SetDataObject

Syntax

 My.Computer.Clipboard.SetDataObject(data) 


data (required; DataObject)

The System.Windows.Forms.DataObject object to be written to the system clipboard

Description

The SetDataObject method writes an object of type System.Widows.Forms.DataObject to the system clipboard. The DataObject class allows a single object to store the same data in multiple formats. For instance, a single data object could store the same data in plain text, Rich Text Format, and HTML.

Usage at a Glance

  • This method is only valid in non-server applications.

  • Security restrictions in place for the active user may limit access to the system clipboard.

Example

The following code adds two types of data to the clipboard.

     Dim pasteData As New System.Windows.Forms.DataObject     pasteData.SetText("This is a pen.")     pasteData.SetData("Japanese-Romaji", "Kore wa pen desu.")     My.Computer.Clipboard.SetDataObject(pasteData) 

Related Framework Entries

  • Microsoft.VisualBasic.MyServices.ClipboardProxy.SetDataObject Method

  • System.Windows.Forms.Clipboard.SetDataObject Method

  • System.Windows.Forms.DataObject Class

  • System.Windows.Forms.IDataObject Interface

See Also

Clipboard Object, GetDataObject Method, SetAudio Method, SetData Method, SetDataObject Method, SetFileDropList Method, SetImage Method, SetText Method




Visual Basic 2005(c) In a Nutshell
Visual Basic 2005 in a Nutshell (In a Nutshell (OReilly))
ISBN: 059610152X
EAN: 2147483647
Year: 2004
Pages: 712

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net