小编Mar*_*ark的帖子

数学运算符不能应用于'double'和'string'类型的操作数

我在equals按钮上有错误.

private void button25_Click(object sender, EventArgs e)
{
    lblShowOp.Text = "";
    switch (operation)
    {
        case "+":
            tb1.Text = (results + Double.Parse(tb1.Text).ToString());
            break;
        case "-":
            // operator '-' cannot be applied to operands of type 'double and string'
            tb1.Text = (results - Double.Parse(tb1.Text).ToString());
            break;
        case "*":
            // operator '*' cannot be applied to operands of type 'double and string'
            tb1.Text = (results * Double.Parse(tb1.Text).ToString());
            break;
        case "/":
            // operator '/' cannot be applied to operands of type 'double and string'
            tb1.Text …
Run Code Online (Sandbox Code Playgroud)

c#

-3
推荐指数
1
解决办法
877
查看次数

标签 统计

c# ×1