这是针对我正在为课堂做的一个项目,我正在尝试创建一个具有 2 个按钮的 win 表单,其中一个按钮在按下按钮时会在文本框中增加,当按下不同按钮时会减少一个按钮. 我很难找到合适的线路来做我想做的事。有没有人可以帮助我?
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Project10TC
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void exitToolStripMenuItem1_Click(object sender, EventArgs e)
{
this.Close();
}
private void aboutToolStripMenuItem_Click(object sender, EventArgs e)
{
MessageBox.Show("Teancum Project 10");
}
private void button1_Click(object sender, EventArgs e)
{
int i = 1;
textBox1.Text = Convert.ToString(i++);
}
private void button2_Click(object sender, EventArgs e)
{
int i = 1;
textBox1.Text = Convert.ToString(i--);
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Clear();
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
}
}