通过按键点击使能定时器,使窗体透明化程度增加


private void button2_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
}

private void timer1_Tick(object sender, EventArgs e)
{
if(this.Opacity >= 0.025)
{
this.Opacity -= 0.025;
}
else
{
timer1.Enabled = false;
this.Close();
Application.Exit();
}
}