c#简易计算器源代码!
{
if (textBox1.Text == "0" || flag == 1)
{
textBox1.Text = "9"; flag = 0;
}
else
{ textBox1.Text = textBox1.Text + "9"; }
button16.Focus();
}
private void button10_Click(object sender, EventArgs e)
{
if (textBox1.Text == "0." || flag == 1)
{
textBox1.Text = "0"; flag = 0;
}
else
{ textBox1.Text = textBox1.Text + "0"; }
button16.Focus();
}
private void button12_Click(object sender, EventArgs e)
{
flag = 1;
dh = 0;
yscs++;
num2 = Convert.ToDouble(textBox1.Text);
switch (ysf)
{
case 1: textBox1.Text = (num1 + num2).ToString(); break; case 2: textBox1.Text = (num1 - num2).ToString(); break; case 3: textBox1.Text = (num1 * num2).ToString(); break; case 4: if (num2 == 0)
{
MessageBox.Show("分母不能为0");
}
textBox1.Text = (num1 / num2).ToString(); break;
}
ysf = 1;
num1 = Convert.ToDouble(textBox1.Text);
button16.Focus();
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说教育文库c#超详细计算器代码(4)在线全文阅读。
相关推荐: