Click here to Skip to main content
15,887,875 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am using microsoft Visual Studio 2005

How do I make a label blink 3 times when i push a button?
i have this code:

VB
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    LBL1.Visible = True
    If LBL1.Visible = True Then
        LBL1.Visible = False
    End If
End Sub


but it doesnt work :/
how do i do it?

super thanks!
Posted
Updated 29-Jun-14 22:41pm
v2
Comments
syed shanu 30-Jun-14 4:21am    
Is this Windows or Webform
syed shanu 30-Jun-14 4:25am    
Chk this links
http://www.codeproject.com/Questions/573941/Howplustoplusmakeplusapluslabelplusblink
http://www.codeproject.com/Questions/406305/How-to-Blink-a-LABEL-in-Asp-net-for-every-5-minute
http://stackoverflow.com/questions/3404228/how-to-blink-a-label-in-asp-net
charliedev 30-Jun-14 4:25am    
windows form
syed shanu 30-Jun-14 4:28am    
You need to use timer :
http://www.codeproject.com/Questions/436491/How-to-show-label-in-blinking-style
http://nareshkamuni.blogspot.kr/2012/04/how-to-blink-text-in-windows-form.html
http://stackoverflow.com/questions/5042516/how-to-implement-a-blinking-label-on-a-form

Check this sample program i made for you :
In windows form
place one Button and Lable:
Button Name as :Button1
Lable Name as :LBL1
Timer conral as Timer1

Declare one public integer variable as ival

VB
' ----  public variable
 Dim ival As Integer = 0
' ----  Button Click Start the Timer
    Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
        LBL1.Visible = True
        Timer1.Interval = 200
        Timer1.Enabled = True
        ival = 0
        Timer1.Start()
        LBL1.Visible = True
    End Sub
' ----  Timer Tick Event blink your label
    Private Sub Timer1_Tick(sender As System.Object, e As System.EventArgs) Handles Timer1.Tick
        If LBL1.Visible = True Then
            LBL1.Visible = False
        Else
            LBL1.Visible = True
        End If
        ival = ival + 1
        If ival = 7 Then
            If LBL1.Visible = False Then
                LBL1.Visible = True
            End If
            Timer1.Stop()
        End If

    End Sub
 
Share this answer
 
Hi,

Use below links

http://stackoverflow.com/questions/3404228/how-to-blink-a-label-in-asp-net[^]

http://www.dotnetspider.com/forum/126647-blinking-text-ASP.aspx[^]

or
try this
XML
<body onload="changeColour('flashtext');">

<script type="text/javascript">

function changeColour(elementId) {
    var interval = 1000;
    var colour1 = "#ff0000";
    var colour2 = "#000000";
    if (document.getElementById) {
        var element = document.getElementById(elementId);
        element.style.color = (element.style.color == colour1) ? colour2 : colour1;
        setTimeout("changeColour('" + elementId + "')", interval);
    }
}

</script>

<p id="flashtext">This text will flash!!!</p></body>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900