Saturday 10 September 2011

Disable a particular key




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

1 comment:

  1. Good one Vikas
    It is really usefull and easy to use...
    Keep doing same and educating us....

    ReplyDelete