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

Irritating blinking of label caption when updated. 1

Status
Not open for further replies.

NarlyMarly

Programmer
Jun 17, 2009
9
US
Maybe it's an 'XP' thing - but my simple 'Big Clock' program that is nothing but a label (with big font) and a timer (1 sec) on a form is updating the time shown in the label's caption with an extremely irritating 'blanking' just before displaying the new caption. (It makes me want to blink.) Anyone know 'what's with that'?
 

Show us some code and maybe placing [tt]Me.Refresh[/tt] or [tt]lblMyTimeLabel.Refresh[/tt] at specific location of your code will eliminate the problem.....

Have fun.

---- Andy
 
Remove the label, use a picture box or even the form itself, print to the picture box...

[tt]
Option Explicit

Private Sub Form_Load()
Timer1.Interval = 1000
Timer1.Enabled = True
Picture1.AutoRedraw = True
Picture1.Appearance = 0
Picture1.BackColor = vbButtonFace
Picture1.FontSize = 30
Picture1.FontBold = True
Picture1.ForeColor = vbRed
Picture1.FontName = "Courier New"
Picture1.Move 0, 0, Me.ScaleWidth, Me.ScaleHeight
End Sub

Private Sub Timer1_Timer()
Picture1.Cls
Picture1.CurrentX = 100
Picture1.CurrentY = 100
Picture1.Print Format(Time, "hh:mm:ss")
End Sub
[/tt]



Good Luck

 
Maybe you could also use LockWindowUpdate?

- Andy
___________________________________________________________________
If you think nobody cares you're alive, try missing a couple of mortgage payments
 
LockWindowUpdate needs a hWnd and labels don't expose a hWnd so one would have to lock the entire form, which may not be desirable...



Good Luck
 
Thank You vb5prgrmr! I didn't have much hope for the Label object (having tried all the dis/enable-refresh things already)- but I had to ask. I'm now reviewing all the other objects with '.print' properties to see what I've been missing. Thanks again - I was hoping the answer wasn't going to be a 'try this api call' thing!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top