111,126
社区成员
发帖
与我相关
我的任务
分享
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 MDI
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text.IndexOf(".") < 0)
{
textBox1.Text = textBox1.Text + ".";
}
}
}
}
bool b = false;
private void point_Click(object sender, EventArgs e)
{
if (!b)
{
num += ".";//------
textBox1.Text += ".";//------
b = true;
//标记---的地方优点啰嗦,只用+=一次就可以了,等值输入完成了在直接给变量赋值不就得了?为什么非要这么麻烦呢?
}
} private void point_Click(object sender, EventArgs e)
{
//计算过程完成后
b = fales;
}