I am working on windows forms in c#. i want to display a picture when I run the program and then that picture automatically disappear after few seconds. For this I made a picture box and gave it a background picture. (I also try giving picture at form load event.)
Then a timer internal property is set to 1000. I made a global variable:
int count=0;
in timer tick event I write a code:
private void timer1_Tick_1(object sender, EventArgs e)
{
count++;
if(count==3)
{
pictureBox1.Visible = false;
timer1.Stop();
}
}
this code does not work.
I tried on the picture click event
private void pictureBox1_Click(object sender, EventArgs e)
{
Thread.Sleep(1000);
pictureBox1.Visible = false;
}
It works but I want to do this automatically not on clicking. How can I do this?