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..

VulpesPosted Jul 6, 2013, 2:48 PM
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 RPosted Jul 7, 2013, 3:40 AM