i created a Timer Control and set some properties
private void MyForm_Load(object sender, EventArgs e)
{
timerClose.Enabled = true;
timerClose.Interval = 10000;
timerClose.Start();
}
One Event of Timer
private void timerClose_Tick(object sender, EventArgs e)
{
this.Text = timerClose.Interval.ToString();
}
but do not have happened. How to update it ?
Does your form display “10000” about 10 seconds after it opens and after that the form’s caption doesn’t change?
If so, your program is doing what it’s supposed to be doing. When your Timer fires it changes your form’s caption to the Timer’s
Intervalproperty, which you’ve set to 10000. That value doesn’t change so your form’s caption won’t change.If your intention is to have your form’s caption increment with every Timer tick create a class level counter that you increment on each tick, like this:
This code will change the form’s caption to “10000” 10 seconds after the form opens and will increment this value by 10000 every 10 seconds after that.