Used to read and write information to and from the Clipboard.
In order to read text from or write text to the Clipboard, you must create an object of type Clipboard and then access the Text or Picture properties of the Clipboard object you create. You can place a picture on the Clipboard by setting the Picture property. You can use the SetText and AddRawData methods to write text or binary data to the Clipboard. The Clipboard class is not available to Console applications.
This example gets the text on the Clipboard and copies it to a variable.
This example puts text on the Clipboard.
This example checks to see if the Clipboard is text data and if so, copies the contents of the clipboard to a TextField.
This example copies an image to the Clipboard:
If ImageWell1.Image <> Nil Then
c.Picture = ImageWell1.Image
MsgBox("No picture is available!")
When you want to put more than one item on the clipboard, you can't use the properties of this class to append new text or graphics to existing material. That is, the following code won't put both text strings on the Clipboard:
Dim text2 As String = "This is the second item being put on the clipboard"
Dim c As New Clipboard
c.Text = text1
c.Text = text2 // Overwrites first text
You need to do the appending in your code and just use one call to the Text property: