Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timers not working when minimized - why?

Status
Not open for further replies.

AndyGroom

Programmer
May 23, 2001
972
GB
This is the first time I've come across this in 10 years of VB programming. If you have a timer on a form with an interval of say 100 and then minimise the running application, the timer stops firing. What's the logic behind that, and is there a way around it?

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
I've just created a new project, single form with a single timer on it (100 interval) with code
Code:
Private Sub Timer1_Timer()

Static intCtr As Integer

intCtr = (intCtr + 1) Mod 10
If intCtr = 0 Then
   Me.Caption = Time
End If

End Sub

When minimized the timer still fires.

Are you sure your timer is not being disabled in another part of your code?

Trevor
 
It's weird, maybe it's a bug in XP because although the minimized caption on the taskbar doesn't change, if you float over it the floatover updates to show the time (in your example).

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
Er....dare I say this.....

"This behavior is by design."

Just joking. I did this:

Code:
Private Sub Timer1_Timer()
Label1.Caption = Now
End Sub

Timer interval set to 10000. I just minimized, waited 30 seconds or so, and found the time to have changed.

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top