Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Window form opacity .. How to control?

I have a single form window application now I want to change the form opacity when application runs. Means when application run it will show low opacity form and as time increse it will show complete form with 100 opacity. So how to do that. (should I use timer control to control opacity, if yes then how????)

like image 842
Constant Learner Avatar asked Dec 30 '11 05:12

Constant Learner


1 Answers

in constructor of the form you can write something like this.

this.Opacity = .1;
timer.Interval = new TimeSpan(0, 0, intervalinminutes);
timer.Tick += ChangeOpacity;
timer.Start();

And then define a method like this

void ChangeOpacity(object sender, EventArgs e)
{
    this.Opacity += .10; //replace.10 with whatever you want
    if(this.Opacity == 1)
        timer.Stop();
}
like image 70
Maheep Avatar answered Nov 05 '22 09:11

Maheep