|
-
October 28th, 2008, 10:36 AM
#1
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.
-
October 28th, 2008, 10:43 AM
#2
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.
-
October 28th, 2008, 11:43 AM
#3
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!
-
October 28th, 2008, 02:41 PM
#4
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.
-
October 28th, 2008, 02:44 PM
#5
Re: How to enable shortcut ctrl+c ctrl+v
Did you read the documentation?
http://msdn.microsoft.com/en-us/libr...tsenabled.aspx
Note:
The TextBox control does not support shortcut keys.
TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
2008, 2009,2010
In theory, there is no difference between theory and practice; in practice there is.
* Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions 
* How NOT to post a question here
* Of course you read this carefully before you posted
* Need homework help? Read this first
-
October 28th, 2008, 07:59 PM
#6
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???
-
October 28th, 2008, 10:07 PM
#7
Re: How to enable shortcut ctrl+c ctrl+v
-
October 28th, 2008, 11:41 PM
#8
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|