C# 如何让一个按钮每按一下,按钮里面的的text值发生变化,按六次,有六个不同的值
1 回答
慕田峪9158850
TA贡献1794条经验 获得超8个赞
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace Q696139
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
string[] arr = { "a", "b", "c", "d", "e" };
int i = 0;
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = arr[i];
i = ++i % arr.Length;
}
}
}- 1 回答
- 0 关注
- 1123 浏览
添加回答
举报
0/150
提交
取消
