在C#winform里面写计算器,总体思路..

来源:百度知道 编辑:UC知道 时间:2024/07/05 16:11:31
不需要优先级~~ 我没有加入括号~~之类的 很简单~ 就是0--9,然后加减乘除~~
设计思路是什么?
我用的是 VS2008 有能提供代码的 加分吧 ~~ 我主要是想理解意思~~
全局变量要设置在哪一个类里面??

第一,首先要设置,输入框只能输入数字类型的值,
第二,用设置几个全局变量,保存,输入的值和计算的结果值,
第三,第一次输入数字以后,按了加减乘除按钮以后,输入框的值保存到一个全局变量里,输入框清空;然后判断是否输入了值,如果没输入,不管,输入了的话,在再次点击加减乘除或者等于的时候,输入框显示计算结果值。

我有一份word的文档~是设计思路~

还有现成的程序~

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

namespace jisuan
{
/// <summary>
/// Form1 的摘要说明。
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.TextBox textBox3;
private System.Windows.Forms.ComboBox comboBox1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.Button button3;
/// <summary>
/// 必需的设计器变量。
/// </summary&g