I am trying to add an \"KeyPress\" event in a textbox (WinForm)
this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(CheckKeys); >
this.textBox1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(CheckKeys);
Have you looked at the documentation on KeyPress? It states specifically that The KeyPress event is not raised by noncharacter keys; however, the noncharacter keys do raise the KeyDown and KeyUp events. Using one of those events instead should work.
KeyPress