views:

458

answers:

2

I am attempting to paste a value from a separate program into a TextEdit control and it doesn't do anything when I use ctrl-v. However, I am able to use right click and paste and that is successful.

Is there a AllowShortcutKeys = true that I am missing?

A: 

Do you have any non-DX controls on the form where you can paste successfully? It's possible that you've got an event on the form that is eating the paste keystroke. Specifically, check the KeyPreview property of the form, and the KeyPress event.

Tim Sullivan
Good call Tim, I cannot paste into a plain .net TextBox, I am using the DevExpress XtraForm for the form. I checked there is nothing registered with the KeyPress event, but KeyPreview was set to false. I tried setting it to true and no change in the functionality. Any other idea's?
Nathan Koop
I'd suggest what Petros said: check to see if you've got a menu for edit that responds to Ctrl+V and has an empty handler, or a handler that checks for a specific type of control.
Tim Sullivan
+1  A: 

If you are using Ctrl+V shortcut for a menu item and the handler of that menu item doesn't do anything, it might precede the functionality of the TextEditor.

Also, if your form is an MDI child, you might want to manually do the copy/paste thing following the instructions of this article http://msdn.microsoft.com/en-us/library/4s6dtf7z.aspx

Petros
It is an MDI child, I'll look into that article that you linked to
Nathan Koop