Solved

CTRL-V Problem

Posted on 1998-05-18
4
1,082 Views
Last Modified: 2012-06-21
I am having a problem with pasting text on a RichTextBox when I use CTRL-V.  When I use the shortcut, the copied text is pasted twice.  This is not the case when I use the EditPaste menu.  I tried taking away the "Ctrl+V" shortcut for my mnuEditPaste and CTRL-V worked well.   I assume that with the "Ctrl+V" shortcut included in the EditPaste menu, the paste function is performed twice.  However, without the "Ctrl+V" for the mnuEditPaste, the Edit menu does not look right.  Now the question is how can I paste texts correctly using CTRL-V with "Ctrl+V" still stated in the EditPaste menu? I tried including "Ctrl+V" in the caption but it cannot be aligned with the other keyboard shortcuts.
0
Comment
Question by:wsanchez
  • 2
4 Comments
 
LVL 7

Accepted Solution

by:
kamall earned 100 total points
ID: 1453490
You can set the KeyPreview property of the form to true, and intercept the Ctrl-V key press in the Form_keyPress event and set the KeyAscii = 0 in the event so that no other code will recognize the Ctrl-V key press. Setting the KeyPreview property of the form to True enables receiving any key press by the form before any other control on the form.
Regards
0
 
LVL 4

Expert Comment

by:yowkee
ID: 1453491
wsanchez,

  What's the code did you put in the mnuEditPaste?
0
 

Author Comment

by:wsanchez
ID: 1453492
Thanks Kamall.
0
 
LVL 7

Expert Comment

by:kamall
ID: 1453493
You are welcome, wsanchez.
For any difficulties, feel free to comment me.
Best regards.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now