comboBox1.SelectedIndex = 0;
textBox1.Text = "这里输入第一个数";
textBox2.Text = "这里输入第二个数";
textBox3.Text = "这里显示计算结果";
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
textBox1.Text = "";
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
textBox2.Text = "";
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
Regex ansreg;
ansreg = new Regex("^[+-]?(([0-9]+[.][0-9]+)|([0-9]+))$");
if (ansreg.IsMatch(textBox3.Text))
{
Clipboard.SetDataObject(textBox3.Text);
MessageBox.Show("计算结果已经复制到剪切板了哟~", "帮助", MessageBoxButtons.OK);
}
}
private void button2_Click(object sender, EventArgs e)
{
string ss_help = "";
ss_help += "使用方法:\n\n";
ss_help += " ①在第一个框中输入第一个操作数\n";
ss_help += " ②在第二个框中输入第二个操作数\n";
ss_help += " ③在下拉列表中选择想要的计算方式\n";
ss_help += " ④点击“=”按钮使结果显示在第三个框中\n";
ss_help += " ⑤输入的数据要求是小数或者整数\n";
ss_help += " ⑥数据计算范围为double类型范围\n";
ss_help += " ⑦得到计算结果后点击第三个框会自动\n 将结果复制到剪切板中哦(~ ̄▽ ̄)~\n\n";
ss_help += "
MessageBox.Show(ss_help, "帮助", MessageBoxButtons.OK);
}
}
}