Techist - Tech Forum - View Single Post - using arrow keys

Click Here to Login
View Single Post
Old 08-26-2004, 08:19 PM   #10 (permalink)
Join Date: Aug 2004
Posts: 50

once you insert that code you just insert a picturebox or an image and insert this code.

Private Sub Picture1_KeyDown(KeyCode As Integer, Shift As Integer)
If Keys(vbKeyUp) Then Picture1.Top = Picture1.Top - 100
If Keys(vbKeyDown) Then Picture1.Top = Picture1.Top + 100
If Keys(vbKeyLeft) Then Picture1.Left = Picture1.Left - 100
If Keys(vbKeyRight) Then Picture1.Left = Picture1.Left + 100
End Sub

if you insert an image instead of a picturebox then obviously you will need to alter the code so it is image1.left or, etc.

Obviously you will need to change the coding if you change the name of the control.
gecko_au2003 is offline  

Copyright 2002- Social Knowledge, LLC All Rights Reserved.

All times are GMT -5. The time now is 03:45 PM.

Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2018, vBulletin Solutions, Inc.