Computer Science Canada I need help |
Author: | Darkmantis [ Tue Dec 06, 2005 6:07 pm ] |
Post subject: | I need help |
How make stuff move around using the arrow keys? |
Author: | pavol [ Wed Dec 07, 2005 10:21 am ] | ||
Post subject: | |||
lets say your 'stuff' is a shape called shpBox. in the form_keydown procedure. you could use some code like this:
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 |
Author: | Darkmantis [ Wed Dec 07, 2005 12:03 pm ] |
Post subject: | |
umm when I press any key the object goes up, how do I make it just move up with the up arrow key? |
Author: | pavol [ Thu Dec 08, 2005 10:13 am ] |
Post subject: | |
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 |
Author: | Darkmantis [ Thu Dec 08, 2005 12:44 pm ] |
Post subject: | |
ok thx a lot |