TechArena Community

TechArena Community (http://forums.techarena.in/)
-   Software Development (http://forums.techarena.in/software-development/)
-   -   Timer control in .Net / Silverlight (http://forums.techarena.in/software-development/1356299.htm)

Isabella 05-08-2010 03:29 PM

Timer control in .Net / Silverlight
 
Hello,
So far, I've always programmed with Visual Basic, and at the time I get around to C #. My IDE is Microsoft Visual Studio 2008 and .NET Framework 3.5. Currently I have the big problem that I want to install a timer, but it does not currently, since no control can be found. Apparently that is so incorrect. So Google had engaged to find me a solution. When I thought it was useful was an error. Can you guys help me with this? Thank you.

Windowed 05-08-2010 03:30 PM

Re: Timer control in .Net / Silverlight
 
Check out if this code can help you
Code:

private void Timer Tool ()
        (
            System.Timers.Timer tm = new Timer ();
            tm.Interval = 1000;
            tm.Elapsed + = new ElapsedEventHandler (tm_xp);
            tm.Enabled = true;
            tm.start ();
        )

        private void tm_xp ()
        (
            time + = 1;
            label1.Content = time;
        )


Isabella 05-08-2010 03:32 PM

Re: Timer control in .Net / Silverlight
 
The "new ElapsedEventHandler," in line 5 is marked as an error. This message is recorded in the error-Windows .
Code:

No overload for 'timer_Elapsed agrees "with the delegates' System.Timers.ElapsedEventHandler match.
I'm still in it:
Code:

using system.time;
Can you help me with this?

Jensen Ackles 05-08-2010 03:35 PM

Re: Timer control in .Net / Silverlight
 
Perhaps it would be better if timer from system.time namespace to not use the, but from the System.Windows.Forms and for the WPF Dispatcher-timer. (But I do not know because I work with WinForms from NET 2.0 only.)

HardWeaR 05-08-2010 03:37 PM

Re: Timer control in .Net / Silverlight
 
I think you should include this part of the code
Code:

  private void tm (Object snd, ElapsedEventArgs e)
        (
            time + = 1;
            lb.Content = time;
        )


Rubero 19-08-2010 11:23 AM

Re: Timer control in .Net / Silverlight
 
It is now, but once a new problem or no problem but a question. But since it is topic-this, I do like a new thread. So thanks for the help it works now.


All times are GMT +5.5. The time now is 07:16 AM.