Solved

CTRL-V Problem

Posted on 1998-05-18
4
1,081 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

707 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

18 Experts available now in Live!

Get 1:1 Help Now