为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

C#
慕森王 2018-07-14 18:22:40
C# 如何让一个按钮每按一下,按钮里面的的text值发生变化,按六次,有六个不同的值
查看完整描述

1 回答

?
慕田峪9158850

TA贡献1794条经验 获得超7个赞

 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;
        }
    }
}


查看完整回答
反对 回复 2018-07-30
  • 1 回答
  • 0 关注
  • 1002 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信