thiago costa

thiago costa

  • NA
  • 319
  • 0

How to parse a system timer interval to string (show timer on label.text) ??

Dec 1 2011 9:21 PM
Hello there guys... This is an example :

1) I have a timer, I have enabled the timer in public void zerg, with interval 9999999
2) How do I make Label1.Text count every second untill it reaches 99999999 ????

In another words, I am just trying to display the timer's current position. Thanks !

I tryed this: but it failed...

this.Invoke(new MethodInvoker(delegate() { label1.Text = TT1.Interval.ToString(); }));

Maybe I was close maybe not... :'( ...


using System.Timers;
private static System.Timers.Timer TT1;
public string music1;
public void zerg()
{
TT1 = new System.Timers.Timer(10000);
            TT1.Elapsed += new ElapsedEventHandler(_event1);
            TT1.Interval = 9999999;
            TT1.Enabled = true;
}
public void _event1(object source, ElapsedEventArgs e)
        {
//CODE !!!
        }


Thanks guys 

Answers (9)