rwp2Lehigh
Solid State Member
- Messages
- 15
Hey all,
I'm a couple of days into teaching myself VB as I have a little C++ background, so don't laugh if I ask a pretty basic question...
I'm making a calculator for the sake of making something, but I'm having a problem getting it to respond to keystrokes. I tried using Keyup, Keydown, and Keypress, but nothing is working. I put the code into the form module as the following:
Private Sub frmCalc_Keyup(Keycode As Integer, Shift As Integer)
Select Case Keycode
Case Asc("0")
Call btn0_Click
Case Asc("1")
Call btn1_Click
Case Asc("2")
Call btn2_Click
End Select
End Sub
And of course I'll add the rest of the keys later once it works. I tried just putting a msgbox(keycode) in the body of the subroutine, but it never gets activated. Any Ideas?
I'm a couple of days into teaching myself VB as I have a little C++ background, so don't laugh if I ask a pretty basic question...
I'm making a calculator for the sake of making something, but I'm having a problem getting it to respond to keystrokes. I tried using Keyup, Keydown, and Keypress, but nothing is working. I put the code into the form module as the following:
Private Sub frmCalc_Keyup(Keycode As Integer, Shift As Integer)
Select Case Keycode
Case Asc("0")
Call btn0_Click
Case Asc("1")
Call btn1_Click
Case Asc("2")
Call btn2_Click
End Select
End Sub
And of course I'll add the rest of the keys later once it works. I tried just putting a msgbox(keycode) in the body of the subroutine, but it never gets activated. Any Ideas?