You are on page 1of 2

public partial class Form1 : Form

{
public Form1()
{
InitializeComponent();
lblHora.Text = DateTime.Now.ToLongTimeString();
}

private void timer1_Tick(object sender, EventArgs e)


{
lblHora.Text = DateTime.Now.ToLongTimeString();

}
private int num = 0;

private void timer2_Tick(object sender, EventArgs e)


{
num = num + 1;
if(num % 2 == 0)
{
lba.Visible = true;
lblb.Visible = false;
}
else
{
lba.Visible = false;
lblb.Visible = true;
}
}

private void btnplay_Click(object sender, EventArgs e)


{
timer2.Enabled = true;
}

private void btnStop_Click(object sender, EventArgs e)


{
timer2.Enabled=false;
}
}
}

You might also like