473,770 Members | 2,781 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Timer driving me nuts

Hi

I have a timer on my form. The problem is no matter how large an interval I
set, the timer_tick event always gets called very fast. What am I doing
wrong?

Thanks

Regards
Aug 28 '06
12 2125
The first is a class too...

As I posted below I successfully used System.Windows. Forms.Timer with a 5
minute (i.e. 300 seconds) timeout. Can you show me where this limitation of
the System.Windows. Forms.Timer control is documented (beacuse I can't find
it)?

/claes

"Theo Verweij" <tv******@xs4al l.nlwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>I think there is a misunderstandin g between the readers.
There are 2 types of timers available:
1. The timer control (System.Windows .Forms.Timer)
2. The timer class (System.Timers. Timer)

The first one is a control, and has a limititation of 64,767 seconds.
The second one is a class, and does not have this limitation.
Claes Bergefall wrote:
>I've never heard of a 32/64/whatever sec limitation (except on Windows
3.x). Both of the following works fine on my machine:

Timer1.Interva l = 60000 '1 minute interval
Timer1.Start ()

Timer1.Interva l = 300000 '5 minute interval
Timer1.Start ()
According to the docs for SetTimer (that System.Windows. Forms.Timer uses)
the maximum value for the interval is USER_TIMER_MAXI MUM. That constant
is defined in winuser.h as 0x7FFFFFFF

There must be something else that's wrong in this case. Show your code

/claes

"John" <Jo**@nospam.in fovis.co.ukwrot e in message
news:Or******* *******@TK2MSFT NGP05.phx.gbl.. .
>>Got it now thanks. My only problem now is to set the interval to about 5
minutes. If the highest interval the timer can take is 32000 (32
seconds?) then how does one get round it?

Thanks again everyone.

Regards

"Stuart Nathan" <st***********@ homecall.co.ukw rote in message
news:en****** ********@TK2MSF TNGP03.phx.gbl. ..
Can we see the code?

Aug 30 '06 #11
I found it in MSDN:
http://msdn2.microsoft.com/en-us/library/xy0zeach.aspx

It actually says that the timer interval is limited to max 64 seconds. Looks
incorrect to me though. Setting it to 2 minutes correctly fires the Tick
event every 2 minutes as expected in my text application. And the underlying
API (SetTimer) doesn't have any 64 sec limitation so why would the Timer
class have it?

/claes

"Claes Bergefall" <lo*****@nospam .nospamwrote in message
news:eW******** ******@TK2MSFTN GP06.phx.gbl...
The first is a class too...

As I posted below I successfully used System.Windows. Forms.Timer with a 5
minute (i.e. 300 seconds) timeout. Can you show me where this limitation
of the System.Windows. Forms.Timer control is documented (beacuse I can't
find it)?

/claes

"Theo Verweij" <tv******@xs4al l.nlwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>>I think there is a misunderstandin g between the readers.
There are 2 types of timers available:
1. The timer control (System.Windows .Forms.Timer)
2. The timer class (System.Timers. Timer)

The first one is a control, and has a limititation of 64,767 seconds.
The second one is a class, and does not have this limitation.
Claes Bergefall wrote:
>>I've never heard of a 32/64/whatever sec limitation (except on Windows
3.x). Both of the following works fine on my machine:

Timer1.Interv al = 60000 '1 minute interval
Timer1.Start( )

Timer1.Interv al = 300000 '5 minute interval
Timer1.Start( )
According to the docs for SetTimer (that System.Windows. Forms.Timer
uses) the maximum value for the interval is USER_TIMER_MAXI MUM. That
constant is defined in winuser.h as 0x7FFFFFFF

There must be something else that's wrong in this case. Show your code

/claes

"John" <Jo**@nospam.in fovis.co.ukwrot e in message
news:Or****** ********@TK2MSF TNGP05.phx.gbl. ..
Got it now thanks. My only problem now is to set the interval to about
5 minutes. If the highest interval the timer can take is 32000 (32
seconds?) then how does one get round it?

Thanks again everyone.

Regards

"Stuart Nathan" <st***********@ homecall.co.ukw rote in message
news:en***** *********@TK2MS FTNGP03.phx.gbl ...
Can we see the code?
>


Aug 30 '06 #12
I also don't know why, but it is documented this way.
Maybe a microsoft employee can explain this?
Claes Bergefall wrote:
I found it in MSDN:
http://msdn2.microsoft.com/en-us/library/xy0zeach.aspx

It actually says that the timer interval is limited to max 64 seconds. Looks
incorrect to me though. Setting it to 2 minutes correctly fires the Tick
event every 2 minutes as expected in my text application. And the underlying
API (SetTimer) doesn't have any 64 sec limitation so why would the Timer
class have it?

/claes

"Claes Bergefall" <lo*****@nospam .nospamwrote in message
news:eW******** ******@TK2MSFTN GP06.phx.gbl...
>The first is a class too...

As I posted below I successfully used System.Windows. Forms.Timer with a 5
minute (i.e. 300 seconds) timeout. Can you show me where this limitation
of the System.Windows. Forms.Timer control is documented (beacuse I can't
find it)?

/claes

"Theo Verweij" <tv******@xs4al l.nlwrote in message
news:%2******* *********@TK2MS FTNGP03.phx.gbl ...
>>I think there is a misunderstandin g between the readers.
There are 2 types of timers available:
1. The timer control (System.Windows .Forms.Timer)
2. The timer class (System.Timers. Timer)

The first one is a control, and has a limititation of 64,767 seconds.
The second one is a class, and does not have this limitation.
Claes Bergefall wrote:
I've never heard of a 32/64/whatever sec limitation (except on Windows
3.x). Both of the following works fine on my machine:

Timer1.Inter val = 60000 '1 minute interval
Timer1.Start ()

Timer1.Inter val = 300000 '5 minute interval
Timer1.Start ()
According to the docs for SetTimer (that System.Windows. Forms.Timer
uses) the maximum value for the interval is USER_TIMER_MAXI MUM. That
constant is defined in winuser.h as 0x7FFFFFFF

There must be something else that's wrong in this case. Show your code

/claes

"John" <Jo**@nospam.in fovis.co.ukwrot e in message
news:Or***** *********@TK2MS FTNGP05.phx.gbl ...
Got it now thanks. My only problem now is to set the interval to about
5 minutes. If the highest interval the timer can take is 32000 (32
seconds?) then how does one get round it?
>
Thanks again everyone.
>
Regards
>
"Stuart Nathan" <st***********@ homecall.co.ukw rote in message
news:en**** **********@TK2M SFTNGP03.phx.gb l...
>Can we see the code?
>>

Aug 30 '06 #13

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
1610
by: Keiron Waites | last post by:
Please see the problem in action here: http://www.leadbullet.biz/contact.php If you mouse over the fields, you will see that text is shown on the right. The text makes the other fields move when it is shown - even though the width of the text is less than the width of the field. WHY? This is driving me nuts - please help! TIA,
12
1614
by: Marty | last post by:
It seems all of the sudden that user controls that contain images are referencing image sources relative to the document that I drop the control on. This obviously does not work beacuase the image source is relative to the user control, not necessarily the form. Can anyone tell me why this would be the case?
0
983
by: Simon Harris | last post by:
Ok, this really is driving me nuts!!! :( 'All' I am trying to do is get the value of a named element. My XML doc is: <?xml version="1.0" encoding="utf-16" standalone="yes" ?> - <Page> <Title>Test</Title> <MetaKeywords>Test</MetaKeywords>
4
1658
by: trond | last post by:
Hello all, Before I start I'd like to point out that I am a complete novice when it comes to asp.net - My background is in network and operating systems, and although I have been doing a bit of hobby programming in vb.net and web programming in asp/vbscript in the past, I am pretty much a beginner at asp.net. What I'm trying to do, is to take the "PersonalHomePage" starter kit that MS supplies with VS2005 and tweak it a bit, to make it...
3
1977
by: Kris Palmer | last post by:
hi, can somebody explain this problem? it's driving me crazy! i have a requirement to dynamically create a variable quantity of timers with associated start button based on the contents of a database. if i create system timers dynamically, i cannot reference them from the start button click event handler. the build error is ' <timer name> not declared> ---- however, if i declare the system timers outside runtime code, everything works...
2
1512
by: mitsura | last post by:
Hi, I need to read a simle XML file. For this I use the SAX parser. So far so good. The XML file consist out of number of "Service" object with each object a set of attributes. I read through the XML file and for each "<Service>" entry I create a new service object. When I am in the "<Service>" part of the XML file and I encounter
4
2474
by: mattlightbourn | last post by:
Hi all, I have a problem which has been driving me nuts. Crosstab queries! I have a database witch a few different tables to do with garment manufacturing. I have a table for a client account, garment type (Jacket, skirt, etc), client sizing spec and descriptives (measurement names i.e: Shoulder to cuff, inside leg, etc), available sizes (ie. 4,6,8,10,12,14,16,18,20,S,M,L,SM,ML,One) and pattern adjustments (if size 10 is the base, the...
3
2287
by: DuncanIdaho | last post by:
Hello experts IE 7.0.5730.11 Opera 9.27 Firefox 2.0.0.14 This problem only occurs in Opera and Firefox (amazing, IE does something right, or maybe not) Anyway, the problem is that when I put an image in a <divor a <td>
4
1684
by: damjanovic | last post by:
Hi all, I have a DB which is designed to have 1 admin and several users on at the same time. The users and admin all work with the same form, called frmOrders, which is a continuous form that lists out, in real time, orders which the users enter. I have a timer form called frmTimer running (hidden) in the background which updates frmOrders every 2 seconds and checks if a new order has been added. If yes, a MsgBox pops up on the admin's screen...
0
9591
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10228
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10057
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8883
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7415
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6676
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5312
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5449
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3575
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.