分类目录

链接

2011 年 12 月
 1234
567891011
12131415161718
19202122232425
262728293031  

近期文章

热门标签

新人福利,免费薅羊毛

现在位置:    首页 > .NET > 正文
C#窗体淡入淡出
.NET 暂无评论 阅读(2,370)
  1.         //淡入
  2.         public int state = 0;
  3.         private void f2_Load(object sender, EventArgs e)
  4.         {
  5.             this.Opacity = 0;
  6.         }  
  7.         private void timer1_Tick(object sender, EventArgs e)
  8.         {
  9.             if (state == 0)
  10.             {
  11.                 this.Opacity += 0.02;
  12.                 if (this.Opacity == 1)
  13.                 {
  14.                     state = 1;
  15.                     timer1.Enabled = false;
  16.                 }
  17.             }
  18.             else
  19.             {
  20.                 this.Opacity = Opacity - 0.02;
  21.                 if (this.Opacity == 0)
  22.                 {
  23.                     Application.ExitThread();
  24.                 }
  25.             }
  26.         }
  27.         //退出
  28.         private void f2closing(object sender, FormClosingEventArgs e)
  29.         {
  30.             e.Cancel = true;
  31.             timer1.Start();
  32.         }

============ 欢迎各位老板打赏~ ===========

本文版权归Bruce's Blog所有,转载引用请完整注明以下信息:
本文作者:Bruce
本文地址:C#窗体淡入淡出 | Bruce's Blog

发表评论

留言无头像?