1private void Form1_Load(object sender, System.EventArgs e)
2 {
3 this.timer1.Enabled=true;
4 //窗体不透明级别
5 this.Opacity=0;
6 }
7
8 /// <summary>
9 /// 定时器事件
10 /// </summary>
11 /// <param name="sender"></param>
12 /// <param name="e"></param>
13 private void timer1_Tick(object sender, System.EventArgs e)
14 {
15 if(this.Opacity<1)
16 {
17 this.Opacity=this.Opacity+0.05;
18 }
19 else
20 {
21 this.timer1.Enabled=false;
22 }
23 }
2 {
3 this.timer1.Enabled=true;
4 //窗体不透明级别
5 this.Opacity=0;
6 }
7
8 /// <summary>
9 /// 定时器事件
10 /// </summary>
11 /// <param name="sender"></param>
12 /// <param name="e"></param>
13 private void timer1_Tick(object sender, System.EventArgs e)
14 {
15 if(this.Opacity<1)
16 {
17 this.Opacity=this.Opacity+0.05;
18 }
19 else
20 {
21 this.timer1.Enabled=false;
22 }
23 }