Hello. I'm currently working on a calculator, (yes, one of those again), and I have it functioning for the most part. Now I'm trying to allow for keyboard input, but when I use Convert.ToChar with numberpad keys, it displays letters instead. I know if I subtract 48 from the keycode value I'll get the corresponding number, but just wondering if there's another way to go about it.
CODE
Private Sub Form1_KeyDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) _
Handles Me.KeyDown
Select Case e.KeyCode
Case Keys.D0 To Keys.D9, Keys.NumPad0 To Keys.NumPad9
btnNumbers(Convert.ToChar(e.KeyCode))
End Select
End Sub
I know that's just one Case condition there. I have some others planned, but I wanted to make this work first. Any help appreciated. Thank you.
This post has been edited by Locuranis: 8 Jul, 2008 - 09:49 AM