西凉董卓 2015-03-26 10:34 采纳率: 100%
浏览 3207
已采纳

C#简单的写一个计算器

初学者,想编一个简单的计算器,基础不够扎实,不能灵活的运气变量,常量,还有我这里应该还需要转换数据类型,大侠们谁帮我 在我的基础上写完这个计算器

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

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

    private void textBox1_TextChanged(object sender, EventArgs e)
    {

    }

    private void button14_Click(object sender, EventArgs e)
    {
         textBox1.Text =textBox1.Text+bnt1.Text;

    }

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

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

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

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

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

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

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

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

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

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

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

    private void button4_Click(object sender, EventArgs e)
    {

    }

    private void button17_Click(object sender, EventArgs e)
    {

    }

    private void Form1_Load(object sender, EventArgs e)
    {

    }
}

}

  • 写回答

4条回答 默认 最新

  • 智者知已应修善业 2015-03-26 11:25
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了
  • ¥50 STM32单片机传感器读取错误
  • ¥50 power BI 从Mysql服务器导入数据,但连接进去后显示表无数据
  • ¥15 (关键词-阻抗匹配,HFSS,RFID标签)
  • ¥50 sft下载大文阻塞卡死
  • ¥15 机器人轨迹规划相关问题
  • ¥15 word样式右侧翻页键消失
  • ¥15 springboot+vue 集成keycloak sso到阿里云
  • ¥15 win7系统进入桌面过一秒后突然黑屏