Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,179,938 members, 7,909,482 topics. Date: Saturday, 03 August 2024 at 06:40 AM

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

Nairaland Forum / Science/Technology / Programming / Problem Using A Numeric Key From Keyboard To Trigger An Event In Vb.net (1082 Views)

Who Can Solve This Problem Using Java / HELP! How Do I Compile Or Create An Installable Format Of A Program In VB.NET / Fizzbuzz Problem Using "Switch" Statement Construct (2) (3) (4)

(1) (Reply)

Problem Using A Numeric Key From Keyboard To Trigger An Event In Vb.net by leastpay(m): 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)

Integrate School Management Software To Your School Website In Less Than 1 Min. / PHP: When To Use Procedural Programming Or OOP / Google AI Just Developed Its Own Secret Language And It’s Really Amazing

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 6
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.