Make a simple animation in winforms using a loop

Posted by Michael Quiles on Stack Overflow See other posts from Stack Overflow or by Michael Quiles
Published on 2010-05-31T16:07:44Z Indexed on 2010/05/31 17:33 UTC
Read the original article Hit count: 168

Filed under:

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;
        }

© Stack Overflow or respective owner

Related posts about c#