Hello,
I want to do a sort of text effect in VB6 I have seen it done before where the text will flash from white to red, white to red, white to red etc...
I am not sure of the coding though?
Thanks
Printable View
Hello,
I want to do a sort of text effect in VB6 I have seen it done before where the text will flash from white to red, white to red, white to red etc...
I am not sure of the coding though?
Thanks
I A TextBox?
For a textbox (you need a timer):
VB Code:
Private Sub Timer1_Timer() If Text1.ForeColor = vbRed Then Text1.ForeColor = vbBlack Else Text1.ForeColor = vbRed End If End Sub Private Sub Form_Load() Timer1.Interval = 10 End Sub
For a label, just replace Text1 with Label1, or whatever the name of the label is.
that just made the label text 1 color? I want the word to be flashing white red white red white red on and on....
The Hobo Did It Right The text was just changing to fast for you to notice:
VB Code:
Private Sub Timer1_Timer() If Text1.ForeColor = vbRed Then Text1.ForeColor = vbWhite Else Text1.ForeColor = vbRed End If End Sub Private Sub Form_Load() Timer1.Interval = 100 End Sub
Just Keep Changing The Timer1.Interval Property untill you have have it the way you like
I Guess I have a slow processor. :( Or eagle eyes.Quote:
Originally posted by ZeroCool
The Hobo Did It Right The text was just changing to fast for you to notice
Hmm, I always thought the timer was measured in milliseconds. Wouldn't it be independent of the processor?
If not, I'm going to need to change my code. :(
if you have a slow processor and you have other tasks running from your app or other, then it would maybe sometimes skip a few times.
Actually, I was just joking, but yeah...see above.Quote:
Originally posted by BuggyProgrammer
if you have a slow processor and you have other tasks running from your app or other, then it would maybe sometimes skip a few times.