The label flashes every time the caption changes (this is the problem).
so what the problem with this?
Also, if I set the timer interval to 1, the label dosent print 1000 milliseconds in a second can anyone explain this?
It happen because you set interval to 1000 in your procedure. Even you set 1 in timer interval but when it executed, there are new statement in your procedure to change interval to 1000. Just remove it.
Dim sec As Integer
Sub Timer1_Timer()
sec = sec + 1
Label1.Caption = Str(sec) + "s"
End Sub
Jx_Man
Senior Poster
3,538 posts since Nov 2007
Reputation Points: 1,488
Solved Threads: 524
Skill Endorsements: 64
I suggest you read this article about the timer control. It discusses millisecond accuracy. To blink the label, just use the label change event to swap the forecolor and backcolor everytime the label changes.
tinstaafl
Nearly a Posting Virtuoso
1,336 posts since Jun 2010
Reputation Points: 360
Solved Threads: 235
Skill Endorsements: 14
The problem might be with the overhead of running the program through VS. The flash might be caused by a delay in refreshing the form.
tinstaafl
Nearly a Posting Virtuoso
1,336 posts since Jun 2010
Reputation Points: 360
Solved Threads: 235
Skill Endorsements: 14
Try DoEvents before the Label Caption assignment
samsylvestertty
Junior Poster in Training
75 posts since Oct 2010
Reputation Points: 22
Solved Threads: 4
Skill Endorsements: 0