473,382 Members | 1,424 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Tmer

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
6 3901
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
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
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

"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
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Julia Sats | last post by:
Hi, I would like to do some operations/checkings in specific moments of time, but my application does not contain form. Can I use any function that work like time control but without window...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.