-
K, here's my problem.
I have a standard edit menu in my application (Cut, Copy, Paste, etc...) with standard ShortCut keys assigned via the menu editor. When the user presses Ctrl+V to paste text, the application pastes the text twice due to Ctrl+V being a Windows Shortcut and also defined in the menu. This doesn't happen in a normal textbox, but I'm using a Rich Text Box which I can't change. How can I trap and stop one set of "Ctrl+V" so the text is only pasted once? Someone suggested removing the code from behind the menu, but I need the menu to be useable as well...Here is the code I have for the menu item:
Code:
frmMain.ActiveForm.rtbText.SelText = Clipboard.GetText
If you can help me with this, I will be eternally grateful!
TIA!!!
-
Hahum... why don't you just remove the shortcut key???
if you really want to keep it you can maybe intercept the WM_PASTE message but I think that would be too much hassle...
or you can check if the text before the text you're going to paste is the same as the text you're going to paste...
-
I had thought of that, but I'd like to keep it if only for appearances sake...If no-one can figure this one out, I'll remove the shortcut key...
-
Sure we can figure it out, but it would be alot hassle...
just add some spaces in the caption of the menu and type CTRL+V after it and the appearance problem is gone as well as the programmaticle prob.