• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 663
  • Last Modified:

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
0
kalaka
Asked:
kalaka
1 Solution
 
appariCommented:
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.
0
 
kalakaAuthor Commented:
What would you suggest to set boundaries for the GUN to move?
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now