flash a lable in windows application using timer [Resolved]

Posted by Sudheep.grandhe under C# on 12/16/2011 | Points: 10 | Views : 5288 | Status : [Member] | Replies : 1
Hi,


This code show how to flash a label in windows application using timer


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

Me.lblLablel.Text = "This is the text to blink!!!!"

CallTimer()

End Sub



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

Me.lblLablel.Visible = Not Me.lblLablel.Visible

End Sub



Public Sub CallTimer()

Timer1.Start()

Timer1.Interval = 500

End Sub

Best,
Sudheep.



Responses

Posted by: Sksingh on: 12/16/2011 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi,

Above code as in C# as below

private void Form1_Load(object sender, EventArgs e)

{
this.lblLablel.Text = "This is the text to blink!!!!";
CallTimer();
}

private void timer1_Tick(object sender, EventArgs e)
{
lblLablel.Visible = !lblLablel.Visible;
}

public void CallTimer()
{
timer1.Start();
timer1.Interval = 500;
}


Change your events name properly.
Hope it will work..

Regards,
Sunil

Sudheep.grandhe, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response