简单的计算器
基本布局:
代码:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Calculator
{
public partial class calculator : Form
{
public calculator()
{
InitializeComponent();
lb_1.Text = null;
}
private void calculator_Load(object sender, EventArgs e)
{
}
private string FuHao;
private float? Mun;
private float? Num;
private bool IsCounting = false;
private bool IsHaving = false;
private bool IsJiSuan = false;
private void ShuRu(string shu)
{
if(!IsCounting)
{
txtShuchu.Text = txtShuchu.Text + shu;
}
else
{
txtShuchu.Text = "";
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Calculator
{
public partial class calculator : Form
{
public calculator()
{
InitializeComponent();
lb_1.Text = null;
}
private void calculator_Load(object sender, EventArgs e)
{
}
private string FuHao;
private float? Mun;
private float? Num;
private bool IsCounting = false;
private bool IsHaving = false;
private bool IsJiSuan = false;
private void ShuRu(string shu)
{
if(!IsCounting)
{
txtShuchu.Text = txtShuchu.Text + shu;
}
else
{
txtShuchu.Text = "";