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

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 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵
  • ¥15 cfx离心泵非稳态计算