Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disable KeyBoard ShortCuts on a textbox

Status
Not open for further replies.

swreng

MIS
Jun 22, 2006
90
GR
Dear all,

Is there anyway to disable the keyboard shortcuts from a textBox (ctl+v,ctl+c,ctl+x Shift+Insert,Shift+Delete,Ctl+Insert) in order the user can not copy,cut or paste data on it only to write something.
Also i would like to hide or disable the pop up menu which is displaying on right click on the textbox.

Many thanks
 
Hey swreng,

Very easy to do this one. You should find a property on your textbox called "ShortcutsEnabled". Simply set this to false.

This also disabled the popup menu you speak of.

Hope this helps.

Regards, Daniel.
 
Hi djfrear and thanks for your reply but i can't find this property in the textbox must i do and something else in order to display it?

I forgot to tell you that i am using visual studio 2003.


Many thanks
 
You can capture the KeyDown event and the mousedown event to do this manually.

e.Cancel = true will prevent the keypress or mouseclick from being performed. Just check which mouse button and which keys have been pressed.

 
as a matter of interest, why do you want to do this?

are you writing a typing tutor?


mr s. <;)

 
Hi to all,

Basically is a request of my client and i think that he has right.

I have a form which the user he can change the application password, so i have 3 textboxes as all the applications:

One for the old password
One for the new password
One to confirm the new password

If by mistake presses a wrong key in the new password and copy that in the confirm new password the application will be confirm and change the password but the really password is not that he thinks (because of the mistake).
That's why


Many thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top