Link to home
Start Free TrialLog in
Avatar of kalaka
kalaka

asked on

vbKeyCode

Option Explicit
Private Sub BackRound_KeyDown(KeyCode As Integer, Shift As Integer)
Select Case KeyCode
Case vbKeyLeft
If GUN.Left <= 300 Then
GoTo NextStep
Else
 GUN.Left = GUN.Left - Grid
 End If
Case vbKeyRight
If GUN.Left >= 300 Then
GoTo NextStep
Else
 GUN.Left = GUN.Left + Grid
 End If
End Select
NextStep:
'unwritten
End Sub
-------------------------------------------------------------------------
The GUN doesnt go right when I press right (vbRight) any ideas?
*Note: Grid has been defined as a Public Const of value 330 on a moudle
ASKER CERTIFIED SOLUTION
Avatar of appari
appari
Flag of India image

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
Avatar of kalaka
kalaka

ASKER

What would you suggest to set boundaries for the GUN to move?