How to enable shortcut ctrl+c ctrl+v
How do I enable the shortcut keys ctrl+c ctrl+v in order to copy and paste some text in my textbox fields?
I have to right click and select paste option in order to paste some text at them.
If I only press ctrl+v nothing occurs.
Thank you in advance.
Re: How to enable shortcut ctrl+c ctrl+v
they are handled by default on text boxes and rich text boxes and you don't have to do anything in order to make it happen.
post some code that can reproduce your issue with it not working.
Re: How to enable shortcut ctrl+c ctrl+v
Hi!
The shortcuts in textboxes are not working in my application. I set the ShortcutsEnable property to true.
It is only possible to copy something to them right clicking the mouse and so, selecting the paste option.
Does someone know how to enable the copy paste shortcuts?
Thank you!
Re: How to enable shortcut ctrl+c ctrl+v
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:
Code:
Clipboard.SetText(textBox1.Text); //put the text of textBox1 in the clipboard
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:
textBox1.Text = Clipboard.GetText();
Or:
Code:
SendKeys.Send(Clipboard.GetText()); //Sending the text in the clipboard to where the cursor is
I'm asumming you are handling with windows application. If not, please tell what kind of project you do work with.
Re: How to enable shortcut ctrl+c ctrl+v
Did you read the documentation?
http://msdn.microsoft.com/en-us/libr...tsenabled.aspx
Quote:
Note:
The TextBox control does not support shortcut keys.
Re: How to enable shortcut ctrl+c ctrl+v
very strange.
I just created a new form, dropped 2 text boxes on it, hit F5, typed in one text box, pressed CTRL + A, CTRL + C, clicked on the second text box, pressed CTRL + V and it pasted in the text...
so how can it work on one machine, and not on another???
Re: How to enable shortcut ctrl+c ctrl+v
Re: How to enable shortcut ctrl+c ctrl+v
Yet, right above the bit which says that the TextBox does not support shortcut keys, there is this little snippet:
Code:
Use the ShortcutsEnabled property to enable or disable the following shortcut key combinations:
*
CTRL+Z
*
CTRL+E
*
CTRL+C
*
CTRL+Y
*
CTRL+X
*
CTRL+BACKSPACE
*
CTRL+V
*
CTRL+DELETE
*
CTRL+A
*
SHIFT+DELETE
*
CTRL+L
*
SHIFT+INSERT
*
CTRL+R
You can override this property to specify other shortcut keys.
They do support standard shortcuts, I don't know what is up with that page.