Victor
Vb have to know that your picture is moving up and down
or left or right
for this you could use a code like the one below.
Be aware that this is assuming a form of 3500 times 3500
you will need to customize to your size and properties
dont forget to dim moveleft as boolean in the form
--------
If moveleft Then
Picture1.Move Picture1.Left - 200, Picture1.Top
If Picture1.Left <= 0 Then moveleft = False
Else
Picture1.Move Picture1.Left + 200, Picture1.Top
If Picture1.Left > 3500 Then moveleft = True
End If
If moveup Then
Picture1.Move Picture1.Left, Picture1.Top - 200
If Picture1.Top <= 0 Then moveup = False
Else
Picture1.Move Picture1.Left, Picture1.Top + 200
If Picture1.Top > 3500 Then moveup = True
End If
----------------
Rolando,
I've tried putting the code on the timer event with an interval of 1, still it doesn't work. it seems
that the picture just go down and then disappears.
I'm trying to simulate a bouncing picture by moving it left and up and if the picture reaches
the top of the form it will move left and down.
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only