Hi victor:
try this code
define moveup as boolean true in your form load
vb needs to know that the picture is moving un or down
you will need to do something similar for the
left, right, and bottom boundaries.
then try this
If moveup Then
Picture1.Move Picture1.Left - 200, Picture1.Top - 200
If Picture1.Top <= 0 Then moveup = False
Else
Picture1.Move Picture1.Left - 200, Picture1.Top + 200
End If
regards
--------------------
Hi,
I have this code on the timer event.
Picture1.Move Picture1.Left - 200, Picture1.Top - 200
' If the graphic reaches the top edge of the form, move it to the 'left and down.
'The code at the bottom doesn't work, the picture just move to the 'left and then disappears.
If Picture1.Top <= 0 Then
Picture1.Move Picture1.Left - 200, Picture1.Top + 200
End If
Previous
Next
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