Share via


My.Computer.Clipboard.SetDataObject Method

Writes a DataObject to the Clipboard.

' Usage
My.Computer.Clipboard.SetDataObject(data)
' Declaration
Public Sub SetDataObject( _
   ByVal data As System.Windows.Forms.DataObject _
)

Parameters

  • data
    DataObject. Data object to be written to the Clipboard. Required.

Remarks

This is an advanced member; it does not show in IntelliSense unless you click the All tab.

Security noteSecurity Note:

Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data.

Example

This example writes the data object dataChunk to the Clipboard.

My.Computer.Clipboard.SetDataObject(dataChunk)

This example depends on the existence of the data object dataChunk.

Requirements

Namespace:Microsoft.VisualBasic.MyServices

Class:ClipboardProxy (provides access to Clipboard)

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

Availability by Project Type

Project type

Available

Windows Application

Yes

Class Library

Yes

Console Application

Yes

Windows Control Library

Yes

Web Control Library

No

Windows Service

Yes

Web Site

No

Permissions

No permissions are required.

See Also

Reference

My.Computer.Clipboard Object

SetDataObject

My.Computer.Clipboard.ContainsData Method

My.Computer.Clipboard.GetData Method

My.Computer.Clipboard.GetDataObject Method

My.Computer.Clipboard.SetData Method

Other Resources

Storing Data to and Reading From the Clipboard