VB6 Tutorial 68: Using the Clipboard

Posted On 2018-06-10 by VB6Boy
Tags: VB6 Tutorials 
Views: 24

Looking for the more of the VB6 Tutorial? Here is the tutorial index.

Clipboard object is a simple object in Visual Basic 6 that stores data. You can retrieve the data from the clipboard using appropriate methods of the clipboard object.

In the Windows operating system, when you copy some data, the data is automatically copied or stored in the clipboard object. You can place data in the clipboard object and retrieve the data from clipboard.

You can easily copy and paste data among applications - from one application to another using the clipboard object. The clipboard object has no properties. It has a few methods that help you work upon the data.

The SetTex method

The SetTex method puts text in the clipboard. In other words, you can place text in the clipboard object using this method.


Clipboard.SetText Text1.Text

The Clear method

The Clear method clears the clipboard.



The GetTex method

The GetTex method lets you retrieve the text which is in clipboard.


Text2.Text = Clipboard.GetText

The SetData method

The SetData method places data e.g an image in clipboard.


Clipboard.SetData Picture1.Picture
' or
Clipboard.SetData LoadPicture("d:\mypic.bmp")

The GetData method

The GetData method retrieves data, for example an image, from the clipboard object.


Picture2.Picture = Clipboard.GetData

Looking for the more of the VB6 Tutorial? Here is the tutorial index.

About the Author

has posted a total of 101 articles.

Comments On This Post

No comments on this post yet!

Do you have a thought relating to this post? You can post your comment here. If you have an unrelated question, you can use the Q&A section to ask it.

Or you can drop a note to the administrators if you're not sure where you should post.

Your IP address is:

Before you can post, you need to prove you are human. If you log in, this test goes away.

Code Links