Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using clipboard features

Status
Not open for further replies.

soodvarun

Programmer
Apr 21, 2001
40
CA
Dear frnds

I have designed an "Edit Menu" where I have cut, copy, paste and delete selections.

I tried with the "Clipboard class" but dont' know how to use it.

Can anyone help me with it?

Will be thankful for your reply.

 
Simply create a string which you want to hold on the clipboard. In your case it may be the contents of a grid cell, as it sounds as if you are using a context menu

Getting data to the clipboard is cut and copy, the only difference been is that cut, clears the original source

Code:
'Cut and Copy
dim s as String
s = "Im Going to the ClipBoard"
System.Windows.Forms.Clipboard.SetDataObject(s, False)
'Paste
s = System.Windows.Forms.clipboard.GetDataObject
txtPaste.text = s



Sweep
...if it works dont mess with it
 
Thanks for your help.

Yes it will work definitly.

But the problem is say I want to access it from the menu and the destination paste box (txtpaste) is not know to me...
It could be anything from a grid cell to textbox to a combo box.

I want sth which can fit every where. I mean something general.

Kindly help me with it.

Varun Sood.





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top