欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來(lái)到入門教程網(wǎng)!

C#教程

當(dāng)前位置:主頁(yè) > 軟件編程 > C#教程 >

C#實(shí)現(xiàn)Winform版計(jì)算器

來(lái)源:本站原創(chuàng)|時(shí)間:2020-01-10|欄目:C#教程|點(diǎn)擊: 次

本文實(shí)例為大家分享Winform版計(jì)算器的具體實(shí)現(xiàn)方法,供大家參考,具體內(nèi)容如下

前臺(tái)頁(yè)面設(shè)計(jì)

后臺(tái)代碼實(shí)現(xiàn)

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 計(jì)算器
{
  public partial class Form1 : Form
  {
    double c, d;
    string m;
    public Form1()
    {
      InitializeComponent();
    }




    private void button2_Click(object sender, EventArgs e)
    {


    }


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


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


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


    }


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


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


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


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


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


    }


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


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


    private void button15_Click(object sender, EventArgs e)
    {
      d= Convert.ToDouble(textBox1.Text);
      switch (m)
      { 
        case("+"):
          textBox1.Text = Convert.ToString(c+d);
          break;
        case ("-"):
          textBox1.Text = Convert.ToString(c-d);
          break;
        case ("*"):
          textBox1.Text = Convert.ToString(c * d);
          break;
        case ("/"):
          textBox1.Text = Convert.ToString(c/d);
          break;


      }
    }


    private void button11_Click(object sender, EventArgs e)
    {
      c = Convert.ToDouble(textBox1.Text);
      textBox1.Text = "";
      m = button11.Text;
    }


    private void button12_Click(object sender, EventArgs e)
    {
      c = Convert.ToDouble(textBox1.Text);
      textBox1.Text = "";
      m = button12.Text;
    }


    private void button13_Click(object sender, EventArgs e)
    {
      c= Convert.ToDouble(textBox1.Text);
      textBox1.Text = "";
      m = button13.Text;
    }


    private void button14_Click(object sender, EventArgs e)
    {
      c = Convert.ToDouble(textBox1.Text);
      textBox1.Text = "";
      m = button14.Text;
    }


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

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家學(xué)習(xí)C#程序設(shè)計(jì)有所幫助。

上一篇:C#在DataTable中根據(jù)條件刪除某一行的實(shí)現(xiàn)方法

欄    目:C#教程

下一篇:C# 文件操作函數(shù) 創(chuàng)建文件 判斷存在

本文標(biāo)題:C#實(shí)現(xiàn)Winform版計(jì)算器

本文地址:http://mengdiqiu.com.cn/a1/C_jiaocheng/6515.html

網(wǎng)頁(yè)制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語(yǔ)言數(shù)據(jù)庫(kù)服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有