|
-
Apr 22nd, 2002, 08:18 PM
#1
Thread Starter
Junior Member
Text Flashing
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
-
Apr 22nd, 2002, 08:25 PM
#2
Hyperactive Member
-
Apr 22nd, 2002, 08:26 PM
#3
Stuck in the 80s
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
-
Apr 22nd, 2002, 08:27 PM
#4
Stuck in the 80s
For a label, just replace Text1 with Label1, or whatever the name of the label is.
-
Apr 22nd, 2002, 08:37 PM
#5
Thread Starter
Junior Member
that just made the label text 1 color? I want the word to be flashing white red white red white red on and on....
-
Apr 22nd, 2002, 09:05 PM
#6
Hyperactive Member
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
-
Apr 23rd, 2002, 05:55 PM
#7
Stuck in the 80s
Originally posted by ZeroCool
The Hobo Did It Right The text was just changing to fast for you to notice
I Guess I have a slow processor. Or eagle eyes.
-
Apr 23rd, 2002, 06:05 PM
#8
Lively Member
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.
- Kronix
"I have not failed. I have merely found 10,000 ways that won't work." - Thomas Edison
-
Apr 23rd, 2002, 06:22 PM
#9
The picture isn't missing
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.
Remember, if someone's post was not helpful, you can always rate their post negatively  .
-
Apr 24th, 2002, 09:13 PM
#10
Stuck in the 80s
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.
Actually, I was just joking, but yeah...see above.
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
|