更新时间:2023-12-03 20:18:04
String[] text = { "hello", "elephant", "pig", "dog" };
int count=0;
private void Button1_Click(object sender, EventArgs e)
{
Label1.Text=text[(count%text.Length)];
count++;
}
尝试类似的方法-
Try something like -
int count=0;
private void Button1_Click(object sender, EventArgs e)
{
if (count > text.Length)
{
count = 0;
}
Label1.Text = text[count++];
}