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 關注
- 1096 瀏覽
添加回答
舉報
0/150
提交
取消
