kante Posted December 16, 2003 Posted December 16, 2003 i use this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textBox1_KeyPress); and then private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e) { MessageBox.Show("" + e.KeyChar);} to catch the every key press in my form.... but why it doesn't work with arrow keys? how can i arrange it to catch all keyboard keys? thank you! Quote
Administrators PlausiblyDamp Posted December 16, 2003 Administrators Posted December 16, 2003 You will need to use either the KeyUp or KeyDown events to catch arrow keys. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
robertsams23 Posted June 19, 2014 Posted June 19, 2014 you must derive a new class that is based on the class of the control that you want, and you override the ProcessCmdKey(). Protected Overrides Function ProcessCmdKey(ByRef msg As Message, ByVal keyData As Keys) As Boolean 'handle your keys here End Function Source Code..VB.Net Arraow Keys Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.