vbKeyCode

kalaka
kalaka used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
I THINK ITS BECOZ OF THIS CONDITION

If GUN.Left >= 300 Then
GoTo NextStep
Else


suppose initial value of Gun.Left=400 then it never goes in to else part. check your condition.
or tell what exactly you were trying to do.

Author

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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial