西凉董卓 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 opencv 无法读取视频
  • ¥15 用matlab 实现通信仿真
  • ¥15 按键修改电子时钟,C51单片机
  • ¥60 Java中实现如何实现张量类,并用于图像处理(不运用其他科学计算库和图像处理库))
  • ¥20 5037端口被adb自己占了
  • ¥15 python:excel数据写入多个对应word文档
  • ¥60 全一数分解素因子和素数循环节位数
  • ¥15 ffmpeg如何安装到虚拟环境
  • ¥188 寻找能做王者评分提取的
  • ¥15 matlab用simulink求解一个二阶微分方程,要求截图