I need help making this loop to move a label move smoothly across the screen using count for the animation (its required). The labels location is currently in location 0,0 I’d like to make it go in a square right -> down -> left -> back to its original position
how can I accomplish this ? please give me an example using my code below. Thank You in advance.
private void xAnimeTimer_Tick(object sender, EventArgs e)
{
int count;
this.xAnimTimer.Stop();
for (count = 0; count <= 100; count++)
{
this.xAnimLabel.Left = count;
}
for (count = 0; count <= 150; count++)
{
this.xAnimLabel.Top = count;
}
I’m not sure why you have to use a for loop (which I believe is your problem [since it appears that each tick we loop completely first; hence why it doesn’t draw ‘cleanly’]) but here’s a stab at it before I’ve had my coffee this afternoon. Note that this probably doesn’t satisfy what you want since you stated you needed a loop. Read the comments for the controls I’m using.