当我输入数字时程序会运行,但是当我退格以输入另一个数字时程序会显示错误

时间:2019-03-01 16:05:47

标签: vb.net

当我输入数字时,程序运行正常,但是当我退格以输入另一个数字时,则显示错误。

public boolean equals(Object other) {
      if(other instanceof Counter) {
        Counter that = (Counter) other;
        return (this.count == that.count);
      }
      else {
          return false;
      }
}

form picture

1 个答案:

答案 0 :(得分:0)

计算之前,您必须检查TextBox1.Text <> ""

If TextBox1.Text <> "" Then
    Label1.Text = "The calculation is " & (TextBox1.Text * 100)
Else
    Label1.Text = "no value"
End If