Link to home
Start Free TrialLog in
Avatar of MaChao
MaChao

asked on

problem with Vbkey constants

Im having a problem with vbkeyconstants

the first is that if i make vbkeyreturn,vbspace,vbkeyseparator have some shortcuts for certain buttons the return displays the answer of the button which is selected with tabindex.

the second is that my vbnumpad shortcuts only work if a button with a integer is selected(slighty highlighted) with the tabindex.

i dunno whether it is a glitch or something if my code: (oh the ones it works on are in an array)

ill post some of the code

Private Sub Digits_Click(Index As Integer) 'digits with numbers, virtual numpad
If Cleardisplay Then
display.Caption = ""
Cleardisplay = False    'clears display
End If
display.Caption = display.Caption + Digits(Index).Caption 'puts value on command.caption into display.caption
If display.Caption = "00" Then display.Caption = 0
 End Sub

Private Sub Digits_Keydown(Index As Integer, KeyCode As Integer, Shift As Integer)
Select Case KeyCode 'keyboard shortcuts
Case vbKey1, vbKeyNumpad1
     Call Digits_Click(1)
Case vbKey2, vbKeyNumpad2
    Call Digits_Click(2)
Case vbKey3, vbKeyNumpad3
    Call Digits_Click(3)
Case vbKey4, vbKeyNumpad4
    Call Digits_Click(4)
Case vbKey5, vbKeyNumpad5
    Call Digits_Click(5)
Case vbKey6, vbKeyNumpad6
    Call Digits_Click(6)
Case vbKey7, vbKeyNumpad7
    Call Digits_Click(7)
Case vbKey8, vbKeyNumpad8
    Call Digits_Click(8)
Case vbKey9, vbKeyNumpad9
    Call Digits_Click(9)
Case vbKey0, vbKeyNumpad0
    Call Digits_Click(0)
Case vbKeyMultiply
    Call times_Click
Case vbKeyAdd
    Call plus_Click
Case vbKeyDivide
    Call divide_Click
Case vbKeySubtract
    Call minus_Click
Case vbKeyDecimal
    Call Dobbtn_Click
Case vbKeyDelete
    Call Clearbttn_Click
Case vbKeyBack
    Call backspace_Click
End Select
End Sub


plz help.

MaChao
Avatar of MaChao
MaChao

ASKER

plz someone help
ASKER CERTIFIED SOLUTION
Avatar of zzzzzooc
zzzzzooc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial