نکته شماره 39 :

 

using System.Threading;
 
 
private void frm_Load(object sender, EventArgs e)
{
    this.Opacity = 0;
    while (this.Opacity < 1)
    {
        this.Opacity += 0.1;
        Thread.Sleep(2);
    }
}
 
 
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
    this.Opacity = 1;
    while (this.Opacity > 0)
    {
        this.Opacity -= 0.1;
        Thread.Sleep(2);
    }
}