VB6 Tutorial 68: Using the Clipboard
No attachments for this post
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 SetText method
The SetText method puts text in the clipboard. In other words, you can place text in the clipboard object using this method.
The Clear method
The Clear method clears the clipboard.
The GetText 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
Comments on this post
You must be logged in to make a comment.