C# Label text changing each second

04/02/2010 23:06 jackpotsvr#1
Hey Coders
I want to make my Labels text changing each second, It must start over at a certain time. how to script this?

Thanks
04/02/2010 23:43 x]vIrus[x#2
add a timer which´s set to 1000ms and have it change the label text in its tick event ,...
04/03/2010 11:19 jackpotsvr#3
Quote:
Originally Posted by x]vIrus[x View Post
add a timer which´s set to 1000ms and have it change the label text in its tick event ,...
Yeah, i found out already, but the only problem is i want it to stop at a certain time and start over. How to do that?

Current Code is

Quote:
private void timer1_Tick(object sender, EventArgs e)
{
Label.Text = Label.Text + "|";
My label called Label as you can see
04/03/2010 12:35 waldi_#4
do so:

Code:
int StopTime = 0;
private void timer1_Tick(object sender, EventArgs e)
{
    if (StopTime <= 10)
    {
      Label.Text += "|";     // " += " is the short way of label1.text = label.text + "?????"
      StopTime++;            //means: StopTime = StopTime + 1 or StopTime += 1
    }
    else
    {
      Label.Text = "";
      StopTime = 0;
    }
}
04/05/2010 12:25 jackpotsvr#5
Quote:
Originally Posted by waldi_ View Post
do so:

Code:
int StopTime = 0;
private void timer1_Tick(object sender, EventArgs e)
{
    if (StopTime <= 10)
    {
      Label.Text += "|";     // " += " is the short way of label1.text = label.text + "?????"
      StopTime++;            //means: StopTime = StopTime + 1 or StopTime += 1
    }
    else
    {
      Label.Text = "";
      StopTime = 0;
    }
}
It works!
Thanks! Im gonna edit it little bit more! XD