Solved

CTRL-V Problem

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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VBA color chart bars 12 86
Can we place a tooltip on the actual vb6 form 5 42
Excel Automation VBA 19 70
Send outlook email from VBS Script 2 30
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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.
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…
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…

772 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