handling timer in C# ASP.NET?

  • Thread starter Thread starter yvw
  • Start date Start date
Y

yvw

Guest
I want to show two pictures once you click on the button.This must be like this; when you click on the button first picture will be visible then after 30 seconds first picture must be invisible and second picture must be visible. (Timer must be implemented)

The code I have written :

int time;
private void button2_Click(object sender, EventArgs e)
{
time = DateTime.Today.Second;
timer1.Enabled = true
}

public void timer1_Tick(object sender, EventArgs e)
{
int min = time;



if (time == min + 1)
{
picrightarrow.Visible = true;
}
if (time == min + 2)
{
picleftarrow.Visible = false;
picrightarrow.Visible = true;
}
}
 
Back
Top