Page 1 of 1

Add slide effect to your form

Posted: Sun Oct 16, 2011 5:10 am
by Bogoh67
So first start off by adding a timer

First Button:
-Interval: 10
-Enabled: False

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Then go into your code view and on the control where you want the sliding to happen put:
Code: Select all
 timer1.Enabled = true; //This turns on the timer so it starts to tick.
Then in the timer code put:
Code: Select all
 {
            try
            {
                Form1.ActiveForm.Width += 2;
                progressBar1.Value += 1;
            }
            catch
            {
            }
            //The code above will add 2 pixels and 1 percentage to the form width and progressbar value.
            {
                if (Form1.ActiveForm.Width == 500 == true)
                    timer1.Enabled = false;
                your control.Enabled = false;
            }
           //This code (when the form's width is = to 500) will shutdown the timer and make the button unavailable.

        }

`````````````````````````````````````````````````````````````````````````````````````

And that should be it
if you have any questions or comments feel free to leave them down below