winform编程
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int[] a=new int[10];
int b = 0;
int c1 = 0;
int c2 = 0;
int c;
private void Form1_Load(object sender, EventArgs e)
{
}
private void button10_Click(object sender, EventArgs e)
{
a[b] = 0;
textBox1.Text += 0;
b++;
}
private void button9_Click(object sender, EventArgs e)
{
a[b] = 1;
textBox1.Text += 1;
b++;
}
private void button8_Click(object sender, EventArgs e)
{
a[b] = 2;
textBox1.Text += 2;
b++;
}
private void button7_Click(object sender, EventArgs e)
{
a[b] = 3;
textBox1.Text += 3;
b++;
}
private void button6_Click(object sender, EventArgs e)
{
a[b] = 4;
textBox1.Text += 4;
b++;
}
private void button5_Click(object sender, EventArgs e)
{
a[b] = 5;
textBox1.Text += 5;
b++;
}
private void button4_Click(object sender, EventArgs e)
{
a[b] = 6;
textBox1.Text += 6;
b++;
}
private void button1_Click(object sender, EventArgs e)
{
a[b] = 7;
textBox1.Text += 7;
b++;
}
private void button2_Click(object sender, EventArgs e)
{
a[b] = 8;
textBox1.Text += 8;
b++;
}
private void button3_Click(object sender, EventArgs e)
{
a[b] = 9;
textBox1.Text += 9;
b++;
}
private void button12_Click(object sender, EventArgs e)
{
if (b != 0)
{
c1 = a[b];
b = 0;
textBox1.Text += "+";
}
}
private void button13_Click(object sender, EventArgs e)
{
c2 = a[b];
c = c1 + c2;
textBox1.Text = Convert.ToString(c1 + c2);
button12.Enabled = true;
}
private void button11_Click(object sender, EventArgs e)
{
b = 0;
c = c1 = c2 = 0;
textBox1.Text=null;
}
}
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int[] a=new int[10];
int b = 0;
int c1 = 0;
int c2 = 0;
int c;
private void Form1_Load(object sender, EventArgs e)
{
}
private void button10_Click(object sender, EventArgs e)
{
a[b] = 0;
textBox1.Text += 0;
b++;
}
private void button9_Click(object sender, EventArgs e)
{
a[b] = 1;
textBox1.Text += 1;
b++;
}
private void button8_Click(object sender, EventArgs e)
{
a[b] = 2;
textBox1.Text += 2;
b++;
}
private void button7_Click(object sender, EventArgs e)
{
a[b] = 3;
textBox1.Text += 3;
b++;
}
private void button6_Click(object sender, EventArgs e)
{
a[b] = 4;
textBox1.Text += 4;
b++;
}
private void button5_Click(object sender, EventArgs e)
{
a[b] = 5;
textBox1.Text += 5;
b++;
}
private void button4_Click(object sender, EventArgs e)
{
a[b] = 6;
textBox1.Text += 6;
b++;
}
private void button1_Click(object sender, EventArgs e)
{
a[b] = 7;
textBox1.Text += 7;
b++;
}
private void button2_Click(object sender, EventArgs e)
{
a[b] = 8;
textBox1.Text += 8;
b++;
}
private void button3_Click(object sender, EventArgs e)
{
a[b] = 9;
textBox1.Text += 9;
b++;
}
private void button12_Click(object sender, EventArgs e)
{
if (b != 0)
{
c1 = a[b];
b = 0;
textBox1.Text += "+";
}
}
private void button13_Click(object sender, EventArgs e)
{
c2 = a[b];
c = c1 + c2;
textBox1.Text = Convert.ToString(c1 + c2);
button12.Enabled = true;
}
private void button11_Click(object sender, EventArgs e)
{
b = 0;
c = c1 = c2 = 0;
textBox1.Text=null;
}
}
