|
-
Mar 9th, 2001, 03:32 PM
#1
Code:
Sub BlinkLbl(lbl As Label)
Do
Start = Timer
Do While Timer < Start + 0.25
DoEvents
Loop
lbl.Visible = Not lbl.Visible
Loop
End Sub
Private Sub Command1_Click()
BlinkLbl Label1
End Sub
-
Mar 10th, 2001, 05:22 AM
#2
Lively Member
Decepticon? What does that mean? More than a Guru?
;-)
Thanks, in fact this code works well!
Bye!
-
Mar 10th, 2001, 09:33 AM
#3
Your Welcome. It's also possible to do this with the SetTimer API, but why use API when this function just the job just as good.
Yeah, you get to choose your own title when you pass 4k.
-
Mar 10th, 2001, 01:41 PM
#4
Fanatic Member
A couple of enhancements to your code, so that the Do Loop will stop and the form will be unloaded when the app is ended....
Code:
Sub BlinkLbl(lbl As Label)
Do Until DoEvents = 0
Start = Timer
Do While Timer < Start + 0.25
DoEvents
Loop
lbl.Visible = Not lbl.Visible
Loop
End Sub
Private Sub Command1_Click()
Call BlinkLbl(lbl)
Unload Me
End Sub
{Insert random techno-babble here}
{Insert quote from some long gone mofo here}
-
Mar 11th, 2001, 05:56 AM
#5
Fanatic Member
In DOS it was much easier to do this!
Sometimes it is also necessary to refresh the label after setting the Visible property of the Label control
-
Mar 11th, 2001, 10:45 AM
#6
Refresh it? I don't think you'd need to do that after you change its Visible property.
-
Mar 12th, 2001, 02:30 PM
#7
Fanatic Member
Unfortunately Yes, Meg.
Often, when working with my applications I ask myself the question "Hey, where is my label control?".
When debugging the code and getting the Visible property of the control, it's should be really visible, but I don't see it. When using the Refresh method after setting the Visible property, everything works fine. strange, but that happens sometimes...
-
Mar 12th, 2001, 02:47 PM
#8
I've worked with VB for over 5 years and I've never has this problem. Perhaps it's just a bug in VB6, because I've used VB3, 4 and 5, but never encountered this.
-
Mar 12th, 2001, 02:54 PM
#9
Fanatic Member
I encounter this in VB3. It also happens sometimes (not often as I said) when changing the Caption property.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|