private void button16_Click(object sender,EventArgs e){switch(s){case"+":b = Convert.ToDouble(textBox1); c = a + b; textBox1.Text = c.ToString();break;case"-":b = Convert.ToDouble(textBox1);c=a-b;textBox1.Text = c.ToString();break;case"*":b = Convert
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/17 09:38:53
private void button16_Click(object sender,EventArgs e){switch(s){case"+":b = Convert.ToDouble(textBox1); c = a + b; textBox1.Text = c.ToString();break;case"-":b = Convert.ToDouble(textBox1);c=a-b;textBox1.Text = c.ToString();break;case"*":b = Convert
private void button16_Click(object sender,EventArgs e)
{
switch(s)
{
case"+":
b = Convert.ToDouble(textBox1); c = a + b; textBox1.Text = c.ToString();break;
case"-":
b = Convert.ToDouble(textBox1);c=a-b;textBox1.Text = c.ToString();break;
case"*":
b = Convert.ToDouble(textBox1);c=a*b;textBox1.Text = c.ToString();break;
case"/":
b = Convert.ToDouble(textBox1);c=a/b;textBox1.Text = c.ToString();break;
}
}
运行后说无法将类型为“System.Windows.Forms.TextBox”的对象强制转换为类型“System.IConvertible”.
private void button16_Click(object sender,EventArgs e){switch(s){case"+":b = Convert.ToDouble(textBox1); c = a + b; textBox1.Text = c.ToString();break;case"-":b = Convert.ToDouble(textBox1);c=a-b;textBox1.Text = c.ToString();break;case"*":b = Convert
b = Convert.ToDouble(textBox1); c = a + b; textBox1.Text = c.ToString();break;
b = Convert.ToDouble(textBox1.Text); c = a + b; textBox1.Text = c.ToString();break;