How to write a coding for keypress?
I tried with the coding of keypress. I'm getting some error. Please help me out.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Mukesh KumarRank #119 · 18.2K reputationPosted Nov 26, 2015, 1:15 AM EST
Use
KeyDownevent to capture keyboard events,private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode.Equals(Keys.NumPad5)) { //Assuming button5 will set the value 5 button5.PerformClick(); } }Nishant MittalRank #692 · 3.5K reputationPosted Nov 26, 2015, 12:49 AM EST
Srikanth Reddy142 reputationPosted Nov 26, 2015, 1:03 AM EST
Ravi PatelRank #439 · 5.7K reputationPosted Nov 26, 2015, 1:10 AM EST