PadCode

Friday, 15 January 2016


Share Up To 110 % - 10% Affiliate Program





1. Animated Graph in C# ( 20 lines code only)


Animated Graph in C# (20 Lines code only)


Step 1(a): Open your Visual Studio 2010/2009/2008 and create new Window based project.

               I am using Visual Studio 2010.   File >> New >> Project



Now  Write your project name like "Animated Form" or "Animated Graph".



Now your project have be opened like as given below:



Now add 2 panel from toolbox and one timer. (If you want then select any background image for form1) like this :



Now you have 8 panels on your form1 with one timer ok!

Click your form 1 load event and write this code:

            panel1.Height = 302;
            panel5.Height = 302;
            panel7.Height = 302;
            panel9.Height = 302;
            this.timer1.Enabled = true;

After it click on timer tick event and write this code :

 if (this.panel1.Height == 302 || this.panel5.Height == 302 || this.panel7.Height == 302 || this.panel9.Height == 302)
                {
                    int i;
                    for (i = 1; i <= 302; i++)
                    {
                        this.panel1.Height = i;
                        this.panel5.Height = i;
                        this.panel7.Height = i;
                        this.panel9.Height = i;
                    }
                }
                else
                {
                    int i;
                    for (i = 1; i <= 302; i++)
                    {
                        this.panel1.Height = i;
                        this.panel5.Height = i;
                        this.panel7.Height = i;
                        this.panel9.Height = i;
                    }
                }

                if (this.panel1.Height == 302 || this.panel5.Height == 302 || this.panel7.Height == 302 || this.panel9.Height == 302)
                {
                    int i;
                    for (i = 302; i >= 1; i--)
                    {
                        this.panel1.Height = i;
                        this.panel5.Height = i;
                        this.panel7.Height = i;
                        this.panel9.Height = i;
                    }
                }



Save your project and run it.

More details about this project click to YouTube Video given below:


Thank-you for read my blog and Please soon come back !
Share Up To 110 % - 10% Affiliate Program

No comments:

Post a Comment