c#window编程关于计算器的问题

来源:百度知道 编辑:UC知道 时间:2024/05/25 08:50:54
计算其中有一个:“+/-”button,如何实现他的功能啊?还有当计算结果是负数的时候结果如何能正常显示。最好把减运算代码写出来,谢谢了!

//此乃windows应用程序
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace MathCalc
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
private System.Windows.Forms.Button Button_x;
private System.Windows.Forms.Button Button18a;
private System.Windows.Forms.Button button5;
private System.Windows.Forms.Button button6;
private System.Windows.Forms.Button Buttonadd;
private System.Windows.Forms.Button button4;
private System.Windows.Forms.Button Buttons;
private System.Windows.Forms.Button Buttonm;
private System.Windows.Forms.Button buttond;
pri