You can use the
KeyPress event to suppress the required keys.
The
e.KeyChar property gives the unicode number of the character.
The following code snippet can be used to suppress the required keys.
int MinKeyCode = 2309;
int MaxKeyCode = 2320;
private void richTextBox1_KeyPress(object sender, KeyPressEventArgs e) {
if (e.KeyChar >= MinKeyCode && e.KeyChar <= MaxKeyCode)
{
e.Handled = true;
}
}
You can use the following code to find out the unicode number of the characters you want to suppress
private void richTextBox1_KeyPress(object sender, KeyPressEventArgs e) {
listBox1.Items.Add(e.KeyChar + " - " + (int)e.KeyChar);
}