By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,672 Members | 1,303 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,672 IT Pros & Developers. It's quick & easy.

Tmer

P: n/a
How do I get this to work?
Libraries to use etc.?
Thanks,
Patrick.

Timer timer = new Timer()
timer.Interval = 1000; // Once a second
timer.Tick += new EventHandler(OnTick);
timer.Enabled = true;
timer.Start();

protected void OnTick(object s, EventArgs ea)
{
MessageBox.Show("Tick Interval");
}
Nov 13 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
What is your problem? If one doesn´t know the problem it cannot be solved :)
Perhaps you just forget the ';' after Timer timer = new Timer() ;-)
Greetings, timtos.

"Patrick De Ridder" <no****@all.eu> wrote in message
news:10***************@evisp-news-01.ops.asmr-01.energis-idc.net...
How do I get this to work?
Libraries to use etc.?
Thanks,
Patrick.

Timer timer = new Timer()
timer.Interval = 1000; // Once a second
timer.Tick += new EventHandler(OnTick);
timer.Enabled = true;
timer.Start();

protected void OnTick(object s, EventArgs ea)
{
MessageBox.Show("Tick Interval");
}

Nov 13 '05 #2

P: n/a
Hi,

He is using System.Windows.Forms.Timer

System.Timers.Timer use the event Epalsed whether the one in Forms use Tick

The different according to MSDN is that the one in Windows.Form is
optimized for use in windows forms application.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Chris Hornberger" <ch***@chornbe.com> wrote in message
news:53*************************@posting.google.co m...
I only use the timers in System.Timers;

using System.Timers;

or

System.Timers.Timer timer = new System.Timers.Timer();
then the rest of your code from there.
How do I get this to work?
Libraries to use etc.?
Thanks,
Patrick.

Timer timer = new Timer()
timer.Interval = 1000; // Once a second
timer.Tick += new EventHandler(OnTick);
timer.Enabled = true;
timer.Start();

protected void OnTick(object s, EventArgs ea)
{
MessageBox.Show("Tick Interval");
}

Nov 13 '05 #3

P: n/a
Not only.

System.Windows.Forms.Timer doesn't work when there is no form, e.g. in
Windows service.

Eliyahu

"Ignacio Machin" <ignacio.machin AT dot.state.fl.us> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
Hi,

He is using System.Windows.Forms.Timer

System.Timers.Timer use the event Epalsed whether the one in Forms use Tick
The different according to MSDN is that the one in Windows.Form is
optimized for use in windows forms application.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Chris Hornberger" <ch***@chornbe.com> wrote in message
news:53*************************@posting.google.co m...
I only use the timers in System.Timers;

using System.Timers;

or

System.Timers.Timer timer = new System.Timers.Timer();
then the rest of your code from there.
> How do I get this to work?
> Libraries to use etc.?
> Thanks,
> Patrick.
>
> Timer timer = new Timer()
> timer.Interval = 1000; // Once a second
> timer.Tick += new EventHandler(OnTick);
> timer.Enabled = true;
> timer.Start();
>
> protected void OnTick(object s, EventArgs ea)
> {
> MessageBox.Show("Tick Interval");
> }
>
>


Nov 13 '05 #4

P: n/a

"Ignacio Machin" <ignacio.machin AT dot.state.fl.us> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
System.Timers.Timer use the event Epalsed whether the one in Forms

use Tick
^^^^^^^^
wow, I've been doing this for a while now, but I've never come across
that "Epalsed" event. What raises it?

he he,
Scott
Nov 13 '05 #5

P: n/a
Hi Scott,

Too much Coffe I think ;) It makes you mix your ginfers :D

Cheers,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Scott" <sc*****@thegapJUNKcompany.com> wrote in message
news:eh**************@tk2msftngp13.phx.gbl...

"Ignacio Machin" <ignacio.machin AT dot.state.fl.us> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
System.Timers.Timer use the event Epalsed whether the one in Forms

use Tick
^^^^^^^^
wow, I've been doing this for a while now, but I've never come across
that "Epalsed" event. What raises it?

he he,
Scott

Nov 13 '05 #6

P: n/a

"Scott" <sc*****@thegapJUNKcompany.com> wrote in message
news:eh**************@tk2msftngp13.phx.gbl...

"Ignacio Machin" <ignacio.machin AT dot.state.fl.us> wrote in message
news:%2***************@TK2MSFTNGP10.phx.gbl...
System.Timers.Timer use the event Epalsed whether the one in Forms

use Tick
^^^^^^^^
wow, I've been doing this for a while now, but I've never come across
that "Epalsed" event. What raises it?

he he,
Scott


Epalsed (elapsed?) whether (whereas?)
This looks like mistakes made by a dyslectic.
You owe Ignacio Machin an apology.

Patrick.

Nov 13 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.