-
how cna i move a picture box if they press up it goes up and down and it goes down and also how can i make it where it wont go close to any lines like if it get to a line it wont go that way like on pac man and it wont go past the form also how cna i do all that please help me please
thanx
justin
-
Set the KeyPreview property of the Form to True. Then add code to the KeyDown event of the Form.
Select Case KeyCode
Case vbKeyUp
Picture1.Top = Picture1.Top - 15 'or whatever
Case vbKeyDown
Picture1.Top = Picture1.Top + 15
Case vbKeyLeft
Picture1.Left = Picture1.Left - 15
Case vbKeyRight
Picture1.Left = Picture1.Left + 15
End Select
Good luck!
------------------
Joacim Andersson
[email protected]
[email protected]
www.YellowBlazer.com
-
and how do i do the other stuff