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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Timer stops showing.

Status
Not open for further replies.

click

MIS
Joined
Jul 19, 2000
Messages
115
Location
US
I have a form with a timer, that shows the time of day as a caption on a label. The timer has an interval of 1000. The time shows ok until you click on a command on the form to continue to other parts of the program. Then the program starts doing something else, and the label blanks out and the timer is not visible until the progrm ends. I have tried to put Label1.Refresh in several spots in the program, but nothing. Here is how I start the timer:
Code:
Private Sub Timer1_Timer()
    Label1.Caption = Time
End Sub
I would appreciate some help if you have ever come across this, or know what's going on. Thank you. Click.[shadessad]
 

When you click on the command button that you mention, is/does your program become listed as not responding (look at the applications tab on task manager). If so you are doing something that does not allow the timer event to fire.

i.e. I can block a timer being fired with a loop like this

Dim I as Integer

Do While I < 100
If I > 1 Then I = 0
Loop

To Allow a timer to fire when there is heavy processing going on you could add a doevents to your loop (if this is the problem).

This can also happen when opening a connection/retrieving a large recordset from a database (that takes a long time).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top