making labels and/or text fields blink 
Author Message
 making labels and/or text fields blink

I'm coding in VB6 using forms.  Ideally, I would like to
have a label blink when it's visible.  Have searched
through help and seems like it's not available.  I guess
I could live with a blinking Text box, but then I
couldn't find out if that's possble either and if it were
then my question would be "how can I make a text box look
like a label (i.e. without the border, etc.)".

I would appreciate some help or direction (or education)
on this matter.

Thanks!

p.s. usually the act of composing a question to the
newsgroup results in me figuring out the answer ... but
not this time.



Fri, 04 Nov 2005 07:01:00 GMT  
 making labels and/or text fields blink


Quote:
> I'm coding in VB6 using forms.  Ideally, I would like to
> have a label blink when it's visible.  Have searched
> through help and seems like it's not available.  I guess
> I could live with a blinking Text box, but then I
> couldn't find out if that's possble either and if it were
> then my question would be "how can I make a text box look
> like a label (i.e. without the border, etc.)".

> I would appreciate some help or direction (or education)
> on this matter.

I suppose you could get fancier than this, but a Timer control should do it.
Start a new project and put a Timer control and a Label control on a form.
Keep the default names.  Copy and paste this code:

-----BEGIN CODE
Option Explicit

Private Sub Form_Load()

    Label1.Caption = "This text will flash"
    Label1.ForeColor = vbRed
    Label1.BackStyle = vbTransparent
    Label1.BorderStyle = vbBSNone
    Timer1.Interval = 500 '1/2 second
    Timer1.Enabled = True

End Sub

Private Sub Form_Unload(Cancel As Integer)

    'Always a good idea to disable timers before closing app
    Timer1.Enabled = False

End Sub

Private Sub Timer1_Timer()

    Label1.Visible = Not Label1.Visible

End Sub

-----END CODE

Mike



Fri, 04 Nov 2005 07:21:40 GMT  
 making labels and/or text fields blink
Thanks for the suggestion ... I guess there's no natural
way to do this.  Your code makes the red label visible
and invisible over and over.  Sounds like something I
would have told someone to do when I was TA-ing at NYU 25
years ago as an undergrad but then I guess that's why
it's still called BASIC.

Hopefully the 500 setting will mean that the blinking is
consistent across Pentium I's IIs IIIs, etc.

Thanks!

Quote:
>-----Original Message-----



>> I'm coding in VB6 using forms.  Ideally, I would like
to
>> have a label blink when it's visible.  Have searched
>> through help and seems like it's not available.  I
guess
>> I could live with a blinking Text box, but then I
>> couldn't find out if that's possble either and if it
were
>> then my question would be "how can I make a text box
look
>> like a label (i.e. without the border, etc.)".

>> I would appreciate some help or direction (or
education)
>> on this matter.

>I suppose you could get fancier than this, but a Timer

control should do it.

- Show quoted text -

Quote:
>Start a new project and put a Timer control and a Label
control on a form.
>Keep the default names.  Copy and paste this code:

>-----BEGIN CODE
>Option Explicit

>Private Sub Form_Load()

>    Label1.Caption = "This text will flash"
>    Label1.ForeColor = vbRed
>    Label1.BackStyle = vbTransparent
>    Label1.BorderStyle = vbBSNone
>    Timer1.Interval = 500 '1/2 second
>    Timer1.Enabled = True

>End Sub

>Private Sub Form_Unload(Cancel As Integer)

>    'Always a good idea to disable timers before closing
app
>    Timer1.Enabled = False

>End Sub

>Private Sub Timer1_Timer()

>    Label1.Visible = Not Label1.Visible

>End Sub

>-----END CODE

>Mike

>.



Fri, 04 Nov 2005 08:04:15 GMT  
 making labels and/or text fields blink

Quote:

> Thanks for the suggestion ... I guess there's no natural
> way to do this.  Your code makes the red label visible
> and invisible over and over.  Sounds like something I
> would have told someone to do when I was TA-ing at NYU 25
> years ago as an undergrad but then I guess that's why
> it's still called BASIC.

> Hopefully the 500 setting will mean that the blinking is
> consistent across Pentium I's IIs IIIs, etc.

You may perhaps wish to read the following site,
http://digilander.libero.it/chiediloapippo/Engineering/iarchitect/ind...,
it may give you some good ideas on UI design.  In particular, "Here's a good
rule of thumb to follow: _people hate blinking_. It is extremely
distracting, and should only be used to draw the user's attention to the
most severe conditions, such as: "Your computer is on fire". "

In other words, either don't make the thing blink, or if you do, make sure
that you provide a method for the user to stop the blinking.

HTH

--
Regards,

Michael Cole



Fri, 04 Nov 2005 08:45:24 GMT  
 making labels and/or text fields blink

Quote:
> Thanks for the suggestion ... I guess there's no natural
> way to do this.

And that's a good thing.  Blinking is almost universally loathed by users.


Fri, 04 Nov 2005 08:47:15 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Making a label blink

2. Problem making a label blink

3. Blinking Text/Label

4. LABEL/TEXT IS BLINKING...

5. BLink blink blink

6. Blinking Label

7. visual basic blinking label

8. Blinking labels

9. Refreshing picture box causing blinking label

10. Blinking labels and list box.

11. How to make a label BLINKs?

12. colors and blinking for a label - How To?

 

 
Powered by phpBB® Forum Software