以下是一个文本框的代码,我想在添加两个文本框,用来输入坐标X,Y,Z的,帮忙添加一下。 String showtext; Calculator clspoint = new Calculator(); private void Form1_Load(object sender, EventArgs e) { //初始化Class1类中的属性 clspoint.DotFlag = false; clspoint.LastInput = "NONE"; clspoint.NumberOps = 0; showtext = textBox1.Text = "0."; } private void button11_Click(object sender, EventArgs e)//.号 { if (clspoint.LastInput == "NUMS") { textBox1.Text = showtext; } else if (clspoint.LastInput == "NEG") { textBox1.Text = "-0."; } clspoint.LastInput = "NUMS"; clspoint.DotFlag = true; textBox1.Text = showtext; } private void button1_Click(object sender, EventArgs e) { clspoint.NumCalculate(1, ref showtext); textBox1.Text = showtext; } private void button2_Click(object sender, EventArgs e) { clspoint.NumCalculate(2, ref showtext); textBox1.Text = showtext; } *******************按是0~9,10个,由于字符限制,就不一一写完了。 private void button14_Click(object sender, EventArgs e)//清空 { textBox1.Text = "0"; clspoint.Firnumber = ""; clspoint.Secnumber = ""; Form1_Load(this, new System.EventArgs()); }
|