The progressive Effect of Form is mainly to use the Opacity attribute of Form and the Timer control. Opacity mainly refers to the Opacity of the Form. Its value ranges from 100% ~ 0%. It can be set to a double value. If it is set to 0.0, the Form is completely transparent. If it is set to 1.0, the Form is completely displayed. The Timer control is mainly used for timing. It has the Interval and Enabled attributes. Interval is used to set the Interval between two times. When Enabled is set to true, the Timer is available. Timer uses a Tick event to add code in it to describe the actions that should be performed along with timing. The specific code is as follows:
Show form gradually
1 this. Opacity = 0.0 // now Set Opacity to 0.0 in Form_Load, which is completely transparent
2 private void timereffectick (object sender, EventArgs e)
3 {
4 this. Opacity + = 0.01; // each time the Form's Opacity attribute is changed
5 if (this. Opacity> = 1.0) // when the Form is fully displayed, stop timing
6 {
7 this. timer1.Enabled = false;
8}
9}
If any of the above errors are found, please kindly advise. Thank you!
From warmth