Down here is the video
Codes down here
I used 3 timers, 1st timer for increment, 2nd timer for buffer, 3rd timer for decrement.
int count = 0, buffer = 0;
public Form1()
{
InitializeComponent();
Opacity = 0;
timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
if(Opacity == 1)
{
timer2.Start();
timer1.Stop();
}
else
{
count++;
Opacity = count * 0.01;
}
}
private void timer2_Tick(object sender, EventArgs e)
{
if(buffer == 3)
{
timer3.Start();
timer2.Stop();
}
else
{
buffer++;
}
}
private void timer3_Tick(object sender, EventArgs e)
{
if(Opacity == 0)
{
Form2 newform = new Form2();
newform.Show();
Hide();
timer3.Stop();
}
else
{
count--;
Opacity = count * 0.01;
}
}
No comments:
Post a Comment