| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 742 人关注过本帖
标题:计算器的问题??
取消只看楼主 加入收藏
半空的spider
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2013-4-28
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:2 
计算器的问题??
  private void button1_Click(object sender, EventArgs e)
        {
            int m;
            textBox1.Text =textBox1.Text+ button1.Text;
            m = int.Parse(textBox1.Text);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            int m;
            textBox1.Text =textBox1.Text+ button2.Text;
            m = int.Parse(textBox1.Text);
        }

        private void button3_Click(object sender, EventArgs e)
        {
            int m;
            textBox1.Text =textBox1.Text+ button3.Text;
            m = int.Parse(textBox1.Text);
        }

        private void button4_Click(object sender, EventArgs e)
        {
            int m;
            textBox1.Text =textBox1.Text+ button4.Text;
            m = int.Parse(textBox1.Text);
        }

        private void button5_Click(object sender, EventArgs e)
        {
            int m;
            textBox1.Text =textBox1.Text+ button5.Text;
            m = int.Parse(textBox1.Text);
        }

        private void button6_Click(object sender, EventArgs e)
        {
            int m;
            textBox1.Text = textBox1.Text + button6.Text;
            m = int.Parse(textBox1.Text);
        }

        private void button7_Click(object sender, EventArgs e)
        {
            int m;
            textBox1.Text = textBox1.Text + button7.Text;
            m = int.Parse(textBox1.Text);
        }

        private void button8_Click(object sender, EventArgs e)
        {
            int m;
            textBox1.Text = textBox1.Text + button8.Text;
            m = int.Parse(textBox1.Text);
        }

        private void button9_Click(object sender, EventArgs e)
        {
            int m;
            textBox1.Text = textBox1.Text + button9.Text;
            m = int.Parse(textBox1.Text);
        }

        private void button10_Click(object sender, EventArgs e)  //以上是一到十的控件
        {
            int m;
            textBox1.Text = textBox1.Text + button10.Text;
            m = int.Parse(textBox1.Text);
        }

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

        private void button12_Click(object sender, EventArgs e)
        {
            textBox1.Text = textBox1.Text + button12.Text;
        }

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

        private void button15_Click(object sender, EventArgs e)
        {
            textBox1.Text = textBox1.Text + button15.Text;
        }

        private void button16_Click(object sender, EventArgs e)  //以上是加减乘除的控件
        {
            textBox1.Text = textBox1.Text + button16.Text;
        }

        private void button14_Click(object sender, EventArgs e) //等号的控件
        {
           int n;
            n=(int.Parse(textBox1.Text))-(int.Parse(textBox1.Text));
            textBox1.Text =Convert.ToString(n);
        }

        private void button17_Click(object sender, EventArgs e)
        {
            textBox1.Text = "";//清除文本框的内容
        }
    }
}     
我想做一个计算器的编程(窗体),我只会以上的代码  接下来就不会。求完整的答案,给我参考一下。
搜索更多相关主题的帖子: void 计算器 private void 计算器 private 
2013-04-29 00:26
半空的spider
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2013-4-28
收藏
得分:0 
谢谢
2013-04-29 23:35
半空的spider
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2013-4-28
收藏
得分:0 
太感谢了,不过我想问一下,类放哪里合适?
2013-04-29 23:52
快速回复:计算器的问题??
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017101 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved