2 Replies - 1927 Views - Last Post: 30 October 2009 - 07:55 AM Rate Topic: -----

#1 Lumpedwink  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-September 09

Moving an Image with keycodes.

Posted 29 October 2009 - 11:27 AM

Greeting One and All!
I come to you with a question.
I need to figure out how to move an Image with Keys (As seen below) I was only able to get it to move shapes. anyone know if it is possible to move an Image with this code below or is it much different?

Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
 If KeyCode = vbKeyEscape Then
	   End
   End If
	
	Select Case KeyCode
		Case vbKeyEscape
			End
		Case vbKeyUp
			shpMove.Top = shpMove.Top - 60
		Case vbKeyDown
			shpMove.Top = shpMove.Top + 60
		Case vbKeyLeft
			shpMove.Left = shpMove.Left - 60
		Case vbKeyRight
			shpMove.Left = shpMove.Left + 60
	End Select
End Sub


Is This A Good Question/Topic? 0
  • +

Replies To: Moving an Image with keycodes.

#2 giuseppe105  Icon User is offline

  • D.I.C Regular

Reputation: 9
  • View blog
  • Posts: 444
  • Joined: 15-May 08

Re: Moving an Image with keycodes.

Posted 29 October 2009 - 02:58 PM

i have no idea why no one would answer but

if the code you posted allows you to move a shape then change the shape with the picture box.

a picture box has the .top and .left properties too so you can move a picture the same way you move shapes

you could even move buttons or labels.
Was This Post Helpful? 0
  • +
  • -

#3 Lumpedwink  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 17-September 09

Re: Moving an Image with keycodes.

Posted 30 October 2009 - 07:55 AM

View Postgiuseppe105, on 29 Oct, 2009 - 01:58 PM, said:

i have no idea why no one would answer but

if the code you posted allows you to move a shape then change the shape with the picture box.

a picture box has the .top and .left properties too so you can move a picture the same way you move shapes

you could even move buttons or labels.


Thanks Alot! I will have to try it later since my VB6 is going through some stupid error.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1