G
Guest
Hi. I have created a 'stop watch' program.
The working principle of the program is to declare an integer (say
'intTime'), which is initalized to zero. Once the user clicks the 'Start'
button, the Timer component (the one found at System.Windows.Forms.Timer)
starts ticking (with this code: Timer.Enabled = True). Whenever the timer
ticks, 'intTime' is inclemented by 1 and this updated number is displayed on
the form. The interval of the Timer is 1000 so its ticks once a second.
The problem is when the window of the program lost focus for a while,
'intTime' freezes and never updates. (I have the TopMost property set to True
so I can see it even when it losts focus.)
How can I fix this problem? Thanks.
The working principle of the program is to declare an integer (say
'intTime'), which is initalized to zero. Once the user clicks the 'Start'
button, the Timer component (the one found at System.Windows.Forms.Timer)
starts ticking (with this code: Timer.Enabled = True). Whenever the timer
ticks, 'intTime' is inclemented by 1 and this updated number is displayed on
the form. The interval of the Timer is 1000 so its ticks once a second.
The problem is when the window of the program lost focus for a while,
'intTime' freezes and never updates. (I have the TopMost property set to True
so I can see it even when it losts focus.)
How can I fix this problem? Thanks.