基本信息
源码名称:WinCE计算器 C#示例源码
源码大小:0.03M
文件格式:.zip
开发语言:C#
更新时间:2019-02-18
   友情提示:(无需注册或充值,赞助后即可获取资源下载链接)

     嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):78630559

本次赞助数额为: 5 元 
   源码介绍

WinCE系统简单计算器



WinCE计算器

public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "0")
                textBox1.Text = "";
            this.textBox1.Text = "1";
        }

        private void button2_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "0")
                textBox1.Text = "";
            this.textBox1.Text = "2";
        }

        private void button3_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "0")
                textBox1.Text = "";
            this.textBox1.Text = "3";
        }

        private void button4_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "0")
                textBox1.Text = "";
            this.textBox1.Text = "4";
        }

        private void button5_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "0")
                textBox1.Text = "";
            this.textBox1.Text = "5";
        }

        private void button6_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "0")
                textBox1.Text = "";
            this.textBox1.Text = "6";
        }

        private void button7_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "0")
                textBox1.Text = "";
            this.textBox1.Text = "7";
        }

        private void button8_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "0")
                textBox1.Text = "";
            this.textBox1.Text = "8";
        }

        private void button9_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "0")
                textBox1.Text = "";
            this.textBox1.Text = "9";
        }

        private void button10_Click(object sender, EventArgs e)
        {
            if (textBox1.Text == "0")
                textBox1.Text = "";
            this.textBox1.Text = "0";
        }

        private void button11_Click(object sender, EventArgs e)
        {
            this.textBox1.Text = ".";
        }

        private void button12_Click(object sender, EventArgs e)
        {
            string s1 = textBox1.Text;
            int len = s1.Length;
            try
            {
                this.textBox1.Text = s1.Substring(0, len - 1);
            }
            catch (Exception)
            {
                DialogResult result = MessageBox.Show("出现异常", "提示");
            }
        }

        private void button13_Click(object sender, EventArgs e)
        {
            this.textBox1.Text = " ";
        }

        private void button14_Click(object sender, EventArgs e)
        {
            this.textBox1.Text = "-";
        }

        private void button15_Click(object sender, EventArgs e)
        {
            this.textBox1.Text = "*";
        }

        private void button16_Click(object sender, EventArgs e)
        {
            this.textBox1.Text = "/";
        }

        private void button17_Click(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            this.textBox1.Text = dt.Compute(textBox1.Text, "").ToString();
        }