Create a menu (Set its visible to false if you don't want the user to see it) and create a new MenuItem called "Copy". Set its shorcut value to "Ctrl+C". Then, create the click event for this menu item, and write the following code inside:
The "Pasting" shortcut is very similar. All you have to do is to create another MenuItem, set its shorcut to "Ctrl+V" and write in the click event:Code:Clipboard.SetText(textBox1.Text); //put the text of textBox1 in the clipboard
Or:Code:textBox1.Text = Clipboard.GetText();
I'm asumming you are handling with windows application. If not, please tell what kind of project you do work with.Code:SendKeys.Send(Clipboard.GetText()); //Sending the text in the clipboard to where the cursor is




Reply With Quote