Regarding clicking a button in windows forms
i have one textbox and a button and i stored multiple string values in it.. when im clicking the button i must show one string value and in the alternate click it has to show another string value, it has to be going on like a loop..
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


VulpesRank #55 · 29.2K reputationPosted Jul 6, 2013, 10:48 AM EDT
private string[] items = {"First", "Second", "Third", "Fourth", "Fifth"};
private int nextIndex = 0;
private btnNext_Click (object sender, EventArgs e)
{
textBox1.Text = items[nextIndex];
nextIndex++;
if (nextIndex >= items.Length) nextIndex = 0;
}
Prasanth R21 reputationPosted Jul 6, 2013, 11:40 PM EDT