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)
gecko_au2003
Banned
 
Join Date: Aug 2004
Posts: 50
Default

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 image1.top, 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 06:14 PM.


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