日期:2014-05-20 浏览次数:21095 次
private void Form1_KeyPress(object sender, KeyPressEventArgs e) { switch ((Keys)e.KeyChar) { case Keys.Add: case Keys.Subtract: case Keys.Multiply: case Keys.Divide: inputText = e.KeyChar.ToString(); buttonAdd_Click(sender, e, inputText); break; case Keys.D1: case Keys.D2: case Keys.D3: case Keys.D4: case Keys.D5: case Keys.D6: case Keys.D7: case Keys.D8: case Keys.D9: case Keys.D0: case Keys.Decimal: inputText = e.KeyChar.ToString(); button1_Click(sender, e,inputText); break; } }