Short C ut Keys
-
How do I trap the ctrlZ, ctrlc and ctrlv on a rich text box from executing when pressed. Please help Nana
I believe the following should work, derive from RichTextBox.
protected override bool IsInputChar(char charCode)
{
switch ((int) charCode)
{
//these are CTRL + char = (int) char
case 1: //CTRL + A
case 3: //CTRL + C
case 6: //CTRL + F
case 22: //CTRL + V
case 24: //CTRL + X
case 26: //CTRL + Z
case 27: //ALT + right, i think
case '\t':
case 8:
case 10: //CTRL + D == Enter
case 13:
return false;
}
} -
I believe the following should work, derive from RichTextBox.
protected override bool IsInputChar(char charCode)
{
switch ((int) charCode)
{
//these are CTRL + char = (int) char
case 1: //CTRL + A
case 3: //CTRL + C
case 6: //CTRL + F
case 22: //CTRL + V
case 24: //CTRL + X
case 26: //CTRL + Z
case 27: //ALT + right, i think
case '\t':
case 8:
case 10: //CTRL + D == Enter
case 13:
return false;
}
}