String text = "hello", "elephant", "pig", "dog"; <pre>private void Button1_Click(object sender, EventArgs e) { Label1.Text = text; }
String[] text = { "hello", "elephant", "pig", "dog" }; int count=0; private void Button1_Click(object sender, EventArgs e) { Label1.Text=text[(count%text.Length)]; count++; }
int count=0; private void Button1_Click(object sender, EventArgs e) { if (count > text.Length) { count = 0; } Label1.Text = text[count++]; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)