|
-
Jan 19th, 2000, 01:19 PM
#1
Thread Starter
Addicted Member
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
-
Jan 19th, 2000, 08:04 PM
#2
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
-
Jan 20th, 2000, 10:40 PM
#3
Thread Starter
Addicted Member
and how do i do the other stuff
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|