Add slide effect to your form

Post your C# code snippets in here.
1 post Page 1 of 1
Contributors
User avatar
Bogoh67
VIP - Site Partner
VIP - Site Partner
Posts: 656
Joined: Sun Apr 18, 2010 8:20 pm

Add slide effect to your form
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
1 post Page 1 of 1
Return to “Quick Snips”