Umarım Yardımcı olmuşumdur.
Timer tmr;
bool ackapa;
public Form1()
{
InitializeComponent();
this.Opacity = 0;
tmr = new Timer();
tmr.Interval = 100;
tmr.Tick += new EventHandler(Opacity_Ayarla);
}
private void Opacity_Ayarla(object sender, EventArgs e)
{
if (ackapa == false)
{
Opacity -= (tmr.Interval / 1000.0);
if (this.Opacity > 0)
tmr.Enabled = true;
else
{
tmr.Enabled = false;
Close();
}
}
else
{
Opacity += (tmr.Interval / 1000.0);
tmr.Enabled = (Opacity < 1.0);
ackapa = (Opacity < 1.0);
}
}
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (e.Cancel == true)
return;
if (Opacity > 0)
{
ackapa = false;
tmr.Enabled = true;
e.Cancel = true;
}
}
private void Form1_Load(object sender, EventArgs e)
{
if (!DesignMode)
{
ackapa = true;
Opacity = 0;
tmr.Enabled = true;
}
}