| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 742 人关注过本帖
标题:计算器的问题??
只看楼主 加入收藏
半空的spider
Rank: 1
等 级:新手上路
帖 子:8
专家分:0
注 册:2013-4-28
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:9 
计算器的问题??
  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
yhlvht
Rank: 13Rank: 13Rank: 13Rank: 13
等 级:贵宾
威 望:36
帖 子:707
专家分:4405
注 册:2011-9-30
收藏
得分:4 
在论坛网页的下边,就是显示贴子页数的下面,有搜索,你搜索一下计算器,应该会找到有用的东西
2013-04-29 01:05
lxb932979339
Rank: 5Rank: 5
等 级:职业侠客
威 望:4
帖 子:84
专家分:313
注 册:2013-4-24
收藏
得分:9 
CalcByClass.zip (49.33 KB)
给你一个完整的
2013-04-29 08:48
半空的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
csharpluntan
Rank: 9Rank: 9Rank: 9
等 级:蜘蛛侠
威 望:7
帖 子:197
专家分:1122
注 册:2013-4-24
收藏
得分:0 
路过

投之以桃,报之以李
2013-04-30 18:03
sq741425
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2013-4-28
收藏
得分:0 
只会c与汇编的路过!
2013-05-01 18:39
moridiansha
Rank: 6Rank: 6
来 自:承德
等 级:侠之大者
威 望:4
帖 子:254
专家分:417
注 册:2009-10-21
收藏
得分:7 
先写出一个功能正确的,然后不断优化,这样学习进步比较快
建议参考《大话设计模式》,第一张就是做计算器的问题

www.qysy.tk
2013-05-02 17:35
无需言
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2013-5-9
收藏
得分:0 
初学者…………
2013-05-09 07:04
wchl868
Rank: 2
来 自:山东济宁
等 级:论坛游民
帖 子:23
专家分:28
注 册:2013-4-26
收藏
得分:0 
学会了教教我

前辈们。小孩子报道,多多指教
2013-05-09 21:38
快速回复:计算器的问题??
数据加载中...
 
   



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

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