惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

雷峰网
雷峰网
GbyAI
GbyAI
Stack Overflow Blog
Stack Overflow Blog
Apple Machine Learning Research
Apple Machine Learning Research
The Cloudflare Blog
WordPress大学
WordPress大学
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 聂微东
L
LangChain Blog
云风的 BLOG
云风的 BLOG
Jina AI
Jina AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
I
InfoQ
大猫的无限游戏
大猫的无限游戏
MyScale Blog
MyScale Blog
人人都是产品经理
人人都是产品经理
小众软件
小众软件
量子位
The GitHub Blog
The GitHub Blog
博客园 - 【当耐特】

博客园 - 夜帝

无进程木马 思路 [转] DateTime 日期操作 C#开发终端式短信的原理和方法 JavaScript实现功能全集 全国网络广播电台地址 转 C#调用Windows API函数 AJAX基础教程 C#一个显示分页页码类 如何用C#语言构造蜘蛛程序 - 夜帝 - 博客园 C#冒泡排序算法 用Visual C#编写仿MSN Messager的滚动提示窗口 创建不规则窗体和控件 初识C#线程 JavaScript中文版(入门) C#日期函数所有样式大全 C#中的“装箱”(boxing)与“拆箱”(unboxing) .net 中随机数的产生 使用C#开发COM+组件 C#算法 -- (三)希尔排序
C#实现窗体淡入淡出效果的几种方法
夜帝 · 2007-09-16 · via 博客园 - 夜帝

1.

  private   void   Form1_Load(object   sender,   System.EventArgs   e)  
  for(double   d=0.01;   d<   1;   d+=0.02)  
  {  
  System.Threading.Thread.Sleep(1);  
  Application.DoEvents();  
  this.Opacity=d;  
  this.Refresh();  
  }

2.

  private   void   timer1_Tick(object   sender,   System.EventArgs   e)  
  {  
  this.Opacity   =   WinShow   ;  
  WinShow   +=   0.1   ;  
  if(WinShow   >=1   )  
  {  
  timer1.Dispose   ();  
  }  
  }

3.

用循环或计时器,  
  frmForm   myForm=new   frmForm()  
  frmForm.Opacity=0;  
  frmForm.show();  
  for(int   i=0;i<100;i++)  
  {  
  Application.DoEvents()  
  frmForm.Opacity=i/100;  
  }

4.

  #region     ********   窗体淡入效果函数       ********  
  private   double   WinShow   =   0;//用于窗口淡入效果的变量  
   
  private   void   FormShow(System.Windows.Forms.Form   Curfrm)  
  {  
  Curfrm.Opacity   =   WinShow   ;  
  WinShow   +=   0.01;  
  if(WinShow   ==   1)  
  {  
  Curfrm.timerShow.Stop   ();  
  }  
  }  
   
  #endregion  
   
  #region     ********   窗体淡入效果函数调用示例       ********  
  //实现窗口的淡入效果  
  private   void   timerShow_Tick(object   sender,   System.EventArgs   e)  
  {  
  //timerShow,这是一个timer控件名称;把timerShow.interval=100就可以了。  
  FormShow(this);  
  }  
  #endregion

http://publishblog.blogchina.com/blog/tb.b?diaryID=5564742