First get a event of your text feild (like text box) in your project
double click on this event of your textbox or richtextbox
this event occurs when ever a key is pressed
now the code,
private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
/////////// do your work here
if ( e.KeyCode == Keys.A)
{
e.Handled = true;
}
}
Enjoy the joy of Coding
God Bless You
Jai SiyaRam