Wednesday, June 9, 2010

Change Text/Image Periodically in Windo application in C#

I have taken a Window Form and add a Label


and a Timer I want Label text should be

change after 5 second





public partial class Form1 : Form

{

public Form1()

{

InitializeComponent();

Timer tm = new Timer();

tm.Tick += new EventHandler(tm_Tick);

tm.Interval = (1000) * (3);

tm.Enabled = true;

tm.Start();

}

int i = 0;

void tm_Tick(object sender, EventArgs e)

{

i++;

Timer tm = (Timer)sender;

if (i == 1)

label1.Text = "NSE";

else if (i == 2)

label1.Text = "BSE";

else if (i == 3)

{

label1.Text = "NCDX";



}

else if (i == 4)

{

label1.Text = "MCX";

i = 0;

}

}

}

No comments:

Post a Comment

Mat Table Angular

Mat Table in Angular Mat table is used to display data . its a material designed styled data-table . For using Material Table MatTableMo...