WinForm窗体淡入效果主要使用到控件的Opacity属性
首先在WinForm窗体中拖入一个Timer控件,然后再Timer控件的Tick事件添加如下代码:
private void timer1_Tick(object sender, EventArgs e) { if (this.Opacity < 1) { this.Opacity = this.Opacity + 0.08; } else { this.timer1.Enabled = false; } }
然后在Form窗体的Load事件中设置Opacity属性初始值为0
private void Form1_Load(object sender, EventArgs e) { this.timer1.Enabled = true; this.Opacity = 0; }
这样一个简单的淡入效果就可以实现了
WinForm窗体淡入效果界面的简单实现方法,布布扣,bubuko.com
原文:http://www.cnblogs.com/tracine0513/p/3634762.html