Blinking Text/Label 
Author Message
 Blinking Text/Label

I'm trying to show a blinking literal in the following fashion:

        checkbox 1           <-- Select all applicable boxes
        checkbox 2
        checkbox 3
        checkbox 4
        checkbox 5
        etc.

The "<-- Select all applicable boxes" is the part that I would like
to have blink.  To do this I have tried to include this text in a
textbox and do the following Windows API calls when the textbox
has GotFocus:

            CreateCaret textbox.hWnd, 1, 1000, 150
            ShowCaret textbox.hWnd
            SetCaretBlinkTime 2000

I would like the foreground text to blink and have the
background color remain constant.  As it stands right
now the foreground text is always present(alternating
colors as the blinking takes place.  The background also
alternates between the initial lighter gray background
colors and the heavier gray that is supplied from the
caret bitmap that I supplied above with the '1' parameter.

Thanks in advance for any advice that you can supply.

        -- Mike



Thu, 02 Jul 1998 03:00:00 GMT  
 Blinking Text/Label

Quote:

>I'm trying to show a blinking literal in the following fashion:

>        checkbox 1           <-- Select all applicable boxes
>        checkbox 2
>        checkbox 3
>        checkbox 4
>        checkbox 5
>        etc.

>The "<-- Select all applicable boxes" is the part that I would like
>to have blink.
>    Some text deleted   <

How about using a timer and setting the caption of a label to the
required text. Then when the timer is enabled, it can be used to either
toggle the label.caption between the above text and "", or simply
toggle the label visible property. I have used this successfully in
splash screens.

Des Morrow



Fri, 03 Jul 1998 03:00:00 GMT  
 Blinking Text/Label

Quote:

>I'm trying to show a blinking literal in the following fashion:
>    checkbox 1           <-- Select all applicable boxes
>    checkbox 2
>    checkbox 3
>    checkbox 4
>    checkbox 5
>    etc.
>The "<-- Select all applicable boxes" is the part that I would like
>to have blink.  To do this I have tried to include this text in a
>textbox and do the following Windows API calls when the textbox
>has GotFocus:
>        CreateCaret textbox.hWnd, 1, 1000, 150
>        ShowCaret textbox.hWnd
>                SetCaretBlinkTime 2000

>I would like the foreground text to blink and have the
>background color remain constant.  As it stands right
>now the foreground text is always present(alternating
>colors as the blinking takes place.  The background also
>alternates between the initial lighter gray background
>colors and the heavier gray that is supplied from the
>caret bitmap that I supplied above with the '1' parameter.
>Thanks in advance for any advice that you can supply.
>    -- Mike

Try the next:

        With a Timer object, you can play with the forecolor and
the backcolor with the label/text. For example:

Initialize Label1.ForeColor with QBColor(15)

Sub Timer1_Timer()
        if Label1.Forecolor = QBColor(15) then
                Label1.Forecolor = QBColor(0)
        Else
                Label1.Forecolor = QBColor(15)
        End if
End Sub



Sat, 04 Jul 1998 03:00:00 GMT  
 Blinking Text/Label

Quote:

>I'm trying to show a blinking literal in the following fashion:

>    checkbox 1           <-- Select all applicable boxes
>    checkbox 2
>    checkbox 3
>    checkbox 4
>    checkbox 5
>    etc.

>The "<-- Select all applicable boxes" is the part that I would like
>to have blink.  To do this I have tried to include this text in a

<snip>

Add a timer control to your form with an interval, say, 500. Then
put the following code into the event routine of the timer. Maybe
not very elegant, but it works.

Sub Timer1_Timer ()
    If Label1.Caption = "" Then
        Label1.Caption = "<-- Select all applicable boxes"
    Else
        Label1.Caption = ""
    End If
End Sub

Set Timer1.Interval to 0 before you hide your form in order
to stop the timer.

Hope this helps.

----------
Haluk Okur / SIMKO A.S.       (Siemens in Turkiye)

Tel   : +90 (216) 389-5940, ext 4563                             -\<,
Fax   : +90 (216) 306-2548                                  ___(*)/(*)___



Sat, 04 Jul 1998 03:00:00 GMT  
 Blinking Text/Label

us, and expelled:

Quote:
>This looks like a good way to make a label blink.  How would you make
>screen printed text blink.  In Quick basic you could add 16 to the
>color code and whatever you printed would blink in that color.  For
>example, to get red use  Color = 4, to get blinking red use Color = 20.

You don't usually print text when you're using VB - you use a
label or text box.

Jens
--
Everything I said are the opinions of someone else.
I just cut-and-pasted.

Jens Balchen jr.       http://www.sn.no/~balchen



Sat, 11 Jul 1998 03:00:00 GMT  
 Blinking Text/Label

Quote:


> threw this at us:

> >Sub Timer1_Timer ()
> >    If Label1.Caption = "" Then
> >        Label1.Caption = "<-- Select all applicable boxes"
> >    Else
> >        Label1.Caption = ""
> >    End If
> >End Sub

> To further enhance this code:

> Sub Timer1_Timer ()
>    Label1.Visible = Not Label1.Visible
> End Sub

> Jens
> --
> * Everything I said are the opinions of someone else.   *
> * I just cut-and-pasted.                                *

> Jens Balchen jr.       http://www.sn.no/~balchen


This looks like a good way to make a label blink.  How would you make
screen printed text blink.  In Quick basic you could add 16 to the
color code and whatever you printed would blink in that color.  For
example, to get red use  Color = 4, to get blinking red use Color = 20.

I've got a program where I'll be locating the cursor and using the
print command to display text on the screen.  I've tried to make it
blink similar to how it was done in Quick basic, but that does not
work.  How should I go about doing this?

Example code:

currentx = 100
currenty = 100
forecolor = RGB(255,0,0)
Print "Hello World"

How can I selectively make this text blink or not blink?

Thanks in advance for your help,

Bryan Fout

Opinions expressed herein are my own and may not represent those of 3M.



Sat, 11 Jul 1998 03:00:00 GMT  
 Blinking Text/Label

infinite reservoars of wisdom, and expelled:

Quote:
>But let's say that this is an unusual case where I am printing text to
>the screen, rather than using a label or a text box . . .

Ouch!

Quote:
>What is the best way to make it blink?

I do believe you have to overwrite the old text with white text,
and then write the text again, to make it blink.

Like:

Do While TextBlink

        picText.CurrentX = txtposX
        picText.CurrentY = txtposY

        ' For the English-speaking, replace Color with Colour
        Color = QBColor(Abs(LastColor - 15))
        LastColor = Color
        picText.ForeColor = QBColor(Color)
        picText.Print textstring$
        picText.Refresh

Loop

Jens
--
Everything I said are the opinions of someone else.
I just cut-and-pasted.

Jens Balchen jr.       http://www.sn.no/~balchen



Mon, 13 Jul 1998 03:00:00 GMT  
 Blinking Text/Label

infinite reservoars of wisdom:

Quote:
>    ' For the English-speaking, replace Color with Colour
>    Color = QBColor(Abs(LastColor - 15))

Correction: The above should read:

Color = Abs(LastColor - 15)

Jens
--
Everything I said are the opinions of someone else.
I just cut-and-pasted.

Jens Balchen jr.       http://www.sn.no/~balchen



Mon, 13 Jul 1998 03:00:00 GMT  
 Blinking Text/Label
Jens,

Thanks for the help!

Bryan

Opinions expressed herein are my own and may not represent those of 3M.



Tue, 14 Jul 1998 03:00:00 GMT  
 Blinking Text/Label

Well, you'd still do the same thing, that is, alternate the foreground
of your hdc to the "visible" foreground then to the "invisible" or
background color.  You'd still have to use a timer, blah, blah, blah.

George


Quote:

>> You don't usually print text when you're using VB - you use a
>> label or text box.

>> Jens
>> --
>But let's say that this is an unusual case where I am printing text to
>the screen, rather than using a label or a text box . . .
>What is the best way to make it blink?
>Thanks for your help,
>Bryan
>Opinions expressed herein are my own and may not represent those of 3M.

===============================================================================
 George R. Torralba              xxxxxxxxxxxx                  Batang Cebu!!!
 Seattle, Washington             206.241.2801              MIME mail accepted
===============================================================================


Tue, 14 Jul 1998 03:00:00 GMT  
 Blinking Text/Label

Quote:

> Do While TextBlink

>    picText.CurrentX = txtposX
>    picText.CurrentY = txtposY

>    ' For the English-speaking, replace Color with Colour
>    Color = QBColor(Abs(LastColor - 15))
>    LastColor = Color
>    picText.ForeColor = QBColor(Color)
>    picText.Print textstring$
>    picText.Refresh

> Loop

I haven't tried this, but I am pretty sure that this will blink
hurrendously (sp???) fast and can't be stopped? Or is it just
me?

TTFN

 _  _____  _   _

| || (_) || `\| |
| ||  _  || , ` | If they give you lined paper, write the other way!
| || | | || |`\ |
(_)(_) (_)(_) (_) http://www.sn.no/~balchen/igloo/



Wed, 15 Jul 1998 03:00:00 GMT  
 Blinking Text/Label

infinite reservoirs of wisdom:

Quote:
>I haven't tried this, but I am pretty sure that this will blink
>hurrendously (sp???) fast and can't be stopped? Or is it just
>me?

It's just a sample, silly you.

Jens
--
Everything I said are the opinions of someone else.
I just cut-and-pasted.

Jens Balchen jr.       http://www.sn.no/~balchen



Thu, 16 Jul 1998 03:00:00 GMT  
 Blinking Text/Label

Quote:

> It's just a sample, silly you.

All the same, a DoEvents wouldn't go amiss.

 _  _____  _   _

| || (_) || `\| |
| ||  _  || , ` | If they give you lined paper, write the other way!
| || | | || |`\ |
(_)(_) (_)(_) (_) http://www.sn.no/~balchen/igloo/



Thu, 16 Jul 1998 03:00:00 GMT  
 
 [ 13 post ] 

 Relevant Pages 

1. making labels and/or text fields blink

2. LABEL/TEXT IS BLINKING...

3. BLink blink blink

4. Making a label blink

5. Blinking Label

6. visual basic blinking label

7. Problem making a label blink

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