469,282 Members | 1,732 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,282 developers. It's quick & easy.

Blinking Text

Is there a way to make text blink in a text box or on a label?

TIA

Brad
Nov 21 '05 #1
7 18801
Brad,

You mean something as this?

\\\
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs)
_
Handles MyBase.Load
Dim aTimer As New System.Timers.Timer
AddHandler aTimer.Elapsed, AddressOf OnTimedEvent
Me.Label1.ForeColor = Drawing.Color.White
aTimer.Interval = 500
Me.Label1.Text = "I am up again"
Me.Label1.BackColor = Drawing.Color.Red
aTimer.Enabled = True
End Sub
Private Sub OnTimedEvent(ByVal source As Object, ByVal e As _
System.Timers.ElapsedEventArgs)
If Me.Label1.BackColor.ToArgb = Drawing.Color.Blue.ToArgb Then
Me.Label1.Text = "I am up again"
Me.Label1.BackColor = Drawing.Color.Red
Else
Me.Label1.Text = "I am to bed"
Me.Label1.BackColor = Drawing.Color.Blue
End If
End Sub
///
I hope this helps a little bit?

Cor

"Brad Markisohn" <db*********@indesign-llc.com> schreef in bericht
news:ee**************@tk2msftngp13.phx.gbl...
Is there a way to make text blink in a text box or on a label?

TIA

Brad

Nov 21 '05 #2

"Brad Markisohn" <db*********@indesign-llc.com> wrote in message
news:ee**************@tk2msftngp13.phx.gbl...
Is there a way to make text blink in a text box or on a label?


I recommend reading this first:
http://digilander.libero.it/chiedilo...al.htm#visual2
Nov 21 '05 #3
Jeff,

Nice link, I have basicly the same ideas as in that article.

Cor
Nov 21 '05 #4
* "Brad Markisohn" <db*********@indesign-llc.com> scripsit:
Is there a way to make text blink in a text box or on a label?


Add a 'System.Windows.Forms.Timer' to your form, set its interval to
500, for example, add a handler to the timer's 'Tick' event and type
this code:

\\\
Me.Label1.Visible = Not Me.Label1.Visible
///

--
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/>
Nov 21 '05 #5
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2o************@uni-berlin.de...
* "Brad Markisohn" <db*********@indesign-llc.com> scripsit:
Is there a way to make text blink in a text box or on a label?


Add a 'System.Windows.Forms.Timer' to your form, set its interval to
500, for example, add a handler to the timer's 'Tick' event and type
this code:

\\\
Me.Label1.Visible = Not Me.Label1.Visible
///


Sweet.
Nov 21 '05 #6
"Ricky W. Hunt" <rh*****@hotmail.com> wrote in message
news:l3cTc.145012$eM2.79933@attbi_s51...
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:2o************@uni-berlin.de...
* "Brad Markisohn" <db*********@indesign-llc.com> scripsit:
Is there a way to make text blink in a text box or on a label?


Add a 'System.Windows.Forms.Timer' to your form, set its interval to
500, for example, add a handler to the timer's 'Tick' event and type
this code:

\\\
Me.Label1.Visible = Not Me.Label1.Visible
///


BTW, I went and fooled around with that. If you use that with a textbox the
whole box blinks. I came up with this:

Public Class Form1

Private fore, back As Color

Private switch As Boolean

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

fore = txtDisplay.ForeColor

back = txtDisplay.BackColor

End Sub

Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Timer1.Tick

txtDisplay.ForeColor = IIf(switch, fore, back)

switch = Not switch

End Sub

End Class
Nov 21 '05 #7

"Cor Ligthert" <no**********@planet.nl> wrote in message
news:e4**************@tk2msftngp13.phx.gbl...
Nice link, I have basicly the same ideas as in that article.


Yes, I agree with MOST of them. I think they went a little overboard in a
couple of places, but overall it's right on the mark.

And some of it is just plain funny.
Nov 21 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Hugo | last post: by
5 posts views Thread by Markus | last post: by
2 posts views Thread by Sharon | last post: by
4 posts views Thread by Lam | last post: by
2 posts views Thread by tony wong | last post: by
3 posts views Thread by fbergroth | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.