?
Solved

how do you disable the ctrl-C/ctrl-V in vb.net

Posted on 2007-08-03
2
Medium Priority
?
1,982 Views
Last Modified: 2013-11-26
In my vb.net application I need to disable the cntrl c (copy) and cntrl v (paste) in the richtextbox.
0
Comment
Question by:mk8guy
2 Comments
 
LVL 4

Expert Comment

by:456838
ID: 19628175
may try

protected overrides sub wndproc(byref m as System.Windows.Forms.Message)
const WM_COPY = &H301
const WM_CUT = &H300
'filter messages
select case m.Msg
case WM_COPY, WM_CUT
MsgBox("u cant do this")
case else
mybase.wndproc(m)
end select
end sub

or anothe reference for you

http://www.codeguru.com/forum/showthread.php?t=298837

http://www.developerfood.com/can-t-ctrl-c-and-richtextbox/microsoft-public-vb-general-discussion/f103577a-c212-410c-b1f8-0a21483b3691/article.aspx
0
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 2000 total points
ID: 19628470
If you are really using VB.Net 2005, then just set the RTB.ShortcutsEnabled property to False:
http://msdn2.microsoft.com/en-us/library/system.windows.forms.textboxbase.shortcutsenabled.aspx

        RichTextBox1.ShortcutsEnabled = False
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In this post we will learn different types of Android Layout and some basics of an Android App.
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

807 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