How to Blink Text - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

How to Blink Text

jbassmanpjbassmanp Posts: 160Member
I want to force a string of text to blink. Is there a command or property for this. Need it to set up an alert situation..

Comments

  • DrMartenDrMarten Posts: 748Member
    [b][red]This message was edited by DrMarten at 2007-3-23 13:25:58[/red][/b][hr]
    : I want to force a string of text to blink. Is there a command or property for this. Need it to set up an alert situation..
    :

    Hi,

    Flash textBox1.text every 1/2 second>>

    [code]
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    '500 is equal to half a second.
    Timer1.Interval = 500
    Timer1.Enabled = True
    Timer1.Start()
    End Sub

    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    If Timer1.Tag = True Then
    TextBox1.Text = "Hi there!!"
    Timer1.Tag = False
    Else
    TextBox1.Clear()
    Timer1.Tag = True
    End If
    End Sub
    [/code]

    You could alternate the colours too.>>
    [code]
    Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    TextBox1.Text = "Hi there!!"
    If Timer1.Tag = True Then
    TextBox1.ForeColor = Color.Black
    TextBox1.BackColor = Color.White
    Timer1.Tag = False
    Else
    TextBox1.ForeColor = Color.White
    TextBox1.BackColor = Color.Black
    Timer1.Tag = True
    End If
    End Sub
    [/code]


    Regards,

    S_DS

  • jbassmanpjbassmanp Posts: 160Member
    [b][red]This message was edited by jbassmanp at 2007-3-24 9:22:54[/red][/b][hr]
    : [b][red]This message was edited by DrMarten at 2007-3-23 13:25:58[/red][/b][hr]
    : : I want to force a string of text to blink. Is there a command or property for this. Need it to set up an alert situation..
    : :
    :
    : Hi,
    :
    : Flash textBox1.text every 1/2 second>>
    :
    : [code]
    : Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    : '500 is equal to half a second.
    : Timer1.Interval = 500
    : Timer1.Enabled = True
    : Timer1.Start()
    : End Sub
    :
    : Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    : If Timer1.Tag = True Then
    : TextBox1.Text = "Hi there!!"
    : Timer1.Tag = False
    : Else
    : TextBox1.Clear()
    : Timer1.Tag = True
    : End If
    : End Sub
    : [/code]
    :
    : You could alternate the colours too.>>
    : [code]
    : Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    : TextBox1.Text = "Hi there!!"
    : If Timer1.Tag = True Then
    : TextBox1.ForeColor = Color.Black
    : TextBox1.BackColor = Color.White
    : Timer1.Tag = False
    : Else
    : TextBox1.ForeColor = Color.White
    : TextBox1.BackColor = Color.Black
    : Timer1.Tag = True
    : End If
    : End Sub
    : [/code]
    :
    :
    : Regards,
    :
    : S_DS
    :
    :
    Hi, I had forgotten about this enquiry I found something else but I will try this method, because I really wanted a flash situation. I was using the timer and some of the same code didn't work so under time constrains I moved on will go back and update.... Thanks in advance.

    Hey Doc. all is fine, it works great. I was close with my code but not quite there. Thanks again.....


  • DrMartenDrMarten Posts: 748Member
    [b][red]This message was edited by DrMarten at 2007-3-24 10:56:58[/red][/b][hr]
    : : : I want to force a string of text to blink. Is there a command or property for this. Need it to set up an alert situation..
    : : :
    : :
    : : Hi,
    : :
    : : Flash textBox1.text every 1/2 second>>
    : :
    : : [code]
    : : Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    : : '500 is equal to half a second.
    : : Timer1.Interval = 500
    : : Timer1.Enabled = True
    : : Timer1.Start()
    : : End Sub
    : :
    : : Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    : : If Timer1.Tag = True Then
    : : TextBox1.Text = "Hi there!!"
    : : Timer1.Tag = False
    : : Else
    : : TextBox1.Clear()
    : : Timer1.Tag = True
    : : End If
    : : End Sub
    : : [/code]
    : :
    : : You could alternate the colours too.>>
    : : [code]
    : : Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
    : : TextBox1.Text = "Hi there!!"
    : : If Timer1.Tag = True Then
    : : TextBox1.ForeColor = Color.Black
    : : TextBox1.BackColor = Color.White
    : : Timer1.Tag = False
    : : Else
    : : TextBox1.ForeColor = Color.White
    : : TextBox1.BackColor = Color.Black
    : : Timer1.Tag = True
    : : End If
    : : End Sub
    : : [/code]
    : :
    : :
    : : Regards,
    : :
    : : S_DS
    : :
    : :
    : Hi, I had forgotten about this enquiry I found something else but I will try this method, because I really wanted a flash situation. I was using the timer and some of the same code didn't work so under time constrains I moved on will go back and update.... Thanks in advance.
    :
    : Hey Doc. all is fine, it works great. I was close with my code but not quite there. Thanks again.....

    ====================================================================

    Hi,

    Your welcome. :-)

    I was thinking of extending the Sub to pass the text to Flash ByVal, i'm sure you can manage that though.

    I also thought of two buttons to either Start / Stop the timer or/and make the flashing textBox Visible or not.

    Regards,

    Dr M.

    P.S.

    By the way i've been away from these forums for a while on the MS VB.Net forums at
    http://forums.microsoft.com/MSDN/default.aspx?ForumGroupID=10&SiteID=1 as user
    i.d.[b][blue] Spidermans_DarkSide [/blue][/b] and busy with the University course i'm on.

Sign In or Register to comment.