C# 如何让一个按钮每按一下,按钮里面的的text值发生变化,按六次,有六个不同的值

  • C# 如何让一个按钮每按一下,按钮里面的的text值发生变化,按六次,有六个不同的值


慕森王
浏览 1007回答 1
1回答

慕田峪9158850

 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;         }     } }
打开App,查看更多内容
随时随地看视频慕课网APP