Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want to make my object move to the right when it gets to a particular point, then it starts all over again.

What I have tried:

VB
label4.move
if label4.move= command
Posted
Updated 4-Nov-23 1:57am
v2
Comments
Richard MacCutchan 3-Nov-23 9:44am    
You just need to repaint it into a new position each time. And don't forget to check whether the rightmost point is at the rightmost edge of the screen. It's all simple mathematics.

1 solution

There is no such thing as a Move method on a label. You have to compute and set the Top and Left properties of the label control t move it to a new location.

To give it constant motion, you have to constantly compute and set those properties for each animation frame. You can create that illusion using the Timer from the Toolbox.
 
Share this answer
 
Comments
Maciej Los 4-Nov-23 13:29pm    
5ed!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900