sampath kumar

sampath kumar

  • NA
  • 4
  • 3.7k

Unable to supress keys

Feb 13 2012 8:15 AM
Hi all,

I am using one RichTextBox in C# Windows Application. I need to restrict the user from entering any key from keyboard at certain conditions. so, I wrote the following line of code in keydown event of RichTextBox at .

private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
e.SuppressKeyPress = true;
}



This is working fine for English US keyboard. But when i changed my regional settings to Korea and keyboard language to Korean, i can enter the Korean characters (like ?????) even after executing the above statement.

even i have tried with the following code


private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
e.SuppressKeyPress = true;
e.Handled = true;
}



but in vain.

Please help.
Thanks in advance. .



Answers (3)