private void timer1_Tick(object sender, System.EventArgs e) //控制慢慢显示
{
if(this.Opacity>0||this.Opacity<1)
{
this.Opacity=(this.Opacity*100+1)/100;
}
else
{
this.Opacity=1;
}
}
private void Form1_Load(object sender, System.EventArgs e)
{
this.Opacity=0;
timer1.Start();
}
private void button1_Click(object sender, System.EventArgs e)
{
timer1.Stop();
timer2.Start();
}
private void timer2_Tick(object sender, System.EventArgs e) //控制慢慢消失
{
if(this.Opacity > 0 || this.Opacity < 1)
{
this.Opacity = (this.Opacity * 100 -1) / 100;
}
else
{
this.Opacity = 0;
}
if(this.Opacity == 0)
{
this.Close();
}
}
[此贴子已经被作者于2006-11-13 19:36:27编辑过]