I created a calculator in VB6. It works ok, except for when I want to enter numbers from the keyboard oppose to clicking with the mouse, I can only enter the numbers once. For example I might want to say 3+2 or 3+3 and so on. What happens is when I keyin 3 plus the number to be calculated; only the number to be calculated can't be entered from the keyboard. The following is a small simple of the code I'm currently working with.
Private Sub cmdDigits_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = Asc("0" Then
lbldisplay.Caption = lbldisplay.Caption + cmdDigits(0).Caption
cmdDigits(0).SetFocus
I also need help programming the rest of the operator keys ( + - * / Backspace etc...). So far everything works fine longs as I'm clicking with the mouse, I trying get things working from the keyboard as well. THANK YOU SO VERY MUCH.
Private Sub cmdDigits_KeyPress(Index As Integer, KeyAscii As Integer)
If KeyAscii = Asc("0" Then
lbldisplay.Caption = lbldisplay.Caption + cmdDigits(0).Caption
cmdDigits(0).SetFocus
I also need help programming the rest of the operator keys ( + - * / Backspace etc...). So far everything works fine longs as I'm clicking with the mouse, I trying get things working from the keyboard as well. THANK YOU SO VERY MUCH.