Turn on or off the screen saver

In a Windows Forms application. I have a splash screen with several multi-threaded processes happening in the background. What I would like to do is when I first display the splash screen, I would like it to look “faded”. And then, as soon as all the processes are over, I would like it to look like the screensaver is "fading". I am using C # and .NET 2.0. Thank.

+4
c # winforms splash-screen
Sep 17 '08 at 15:04
source share
4 answers

You can use a timer to change the level of Form.Opacity .

+9
Sep 17 '08 at 15:06
source share

When using the Opacity property, it must be remembered that its type is double, where 1.0 is full opacity, and 0.0 is full transparency.

private void fadeTimer_Tick(object sender, EventArgs e) { this.Opacity -= 0.01; if (this.Opacity <= 0) { this.Close(); } } 
+5
Sep 17 '08 at 15:20
source share

You can use the Opacity property of the form to change the attenuation (between 0.0 and 1.0).

+3
Sep 17 '08 at 15:05
source share
 While(this.Opacity !=0) { this.Opacity -= 0.05; Thread.Sleep(50);//This is for the speed of the opacity... and will let the form redraw } 
+2
Sep 17 '08 at 15:08
source share



All Articles