110,567
社区成员
发帖
与我相关
我的任务
分享
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
int times = 0;
public Form1()
{
InitializeComponent();
Store st = new Store();
}
private void button1_Click(object sender, EventArgs e)
{
times++;
button1.Text=Store.GetButtonText(times);
}
}
class Store
{
static List<string> listText = new List<string>();
public Store()
{
listText.Add("Add new verb");
listText.Add("Enter");
}
public static string GetButtonText(int times)
{
if (times % 2 == 1)
{
return listText[1];
}
else
{
return listText[0];
}
}
}
}