
-----------------------------------
Darkmantis
Tue Dec 06, 2005 6:07 pm

I need help
-----------------------------------
How make stuff move around using the arrow keys?

-----------------------------------
pavol
Wed Dec 07, 2005 10:21 am


-----------------------------------
lets say your 'stuff' is a shape called shpBox. in the form_keydown procedure. you could use some code like this:
Select Case vbKeyCode
     Case vbKeyUp
          For i = 1 To 100
              For j = 1 To 1000000
                    shpBox.Top = shpBox.Top - 100
              Next j
          Next i

End Select
the for loop just simply moves the object but the part that makes shpBox move up using the arrow key is select case vbkeycode case vbkeyup. vbkeyup is used for the up arrow key, vbkeydown for the down arrow key and so on. 
hope this helps

-----------------------------------
Darkmantis
Wed Dec 07, 2005 12:03 pm


-----------------------------------
umm when I press any key the object goes up, how do I make it just move up with the up arrow key?

-----------------------------------
pavol
Thu Dec 08, 2005 10:13 am


-----------------------------------
forgot to include that part
to make it go up you use the code shpBox.Top = shpBox.Top - 100(or whatever speed you choose), down would be shpBox.Top = shpBox.Top +100, left : shpBox.Left = shpBox.Left -100, and right : shpBox.Left = shpBox.Left +100

-----------------------------------
Darkmantis
Thu Dec 08, 2005 12:44 pm


-----------------------------------
ok thx a lot
