₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,216 members, 8,420,860 topics. Date: Friday, 05 June 2026 at 12:55 PM

Toggle theme

Problem Using A Numeric Key From Keyboard To Trigger An Event In Vb.net - Programming - Nairaland

Nairaland ForumScience/TechnologyProgrammingProblem Using A Numeric Key From Keyboard To Trigger An Event In Vb.net (1174 Views)

1 Reply

Problem Using A Numeric Key From Keyboard To Trigger An Event In Vb.net by leastpay(op): 5:16pm On Jan 13, 2016
i want an instance when i press 1 or 2 or 3 from my keyboard an event will occur. actually the code below works well when there is no single control on the form. but once i add a control like button it won't work again. please someone should help.

Private Sub frmMain_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
Select Case e.KeyCode
Case Keys.D1
MessageBox.Show("1 pressed")
Case Keys.D2
MessageBox.Show("2 pressed")
Case Keys.D3
MessageBox.Show("3 pressed")
End Select
End Sub
1 Reply

Who Can Solve This Problem Using JavaHELP! How Do I Compile Or Create An Installable Format Of A Program In VB.NETFizzbuzz Problem Using "Switch" Statement Construct234

Sending E-maill With JAVAA 10-year Discovered Security Problem On Instagram Application And Got $10,000Programmers Please Help Me Out