【发布时间】:2017-06-12 21:41:44
【问题描述】:
我可以知道有什么简单的方法来执行此操作吗?当 a.text 为空时,它会出错。如果没有一一检测,可以用简单的代码将a.text null转为0吗?
Dim count1 As Integer = 0
count1 = Convert.ToInt32(a.Text) + Convert.ToInt32(b.Text) + Convert.ToInt32(c.Text)
txt_display.Text = count1
有任何其他方法,而不是我喜欢在下面一一检测。
if a.Text = "" Then
a.Text = 0
End If
【问题讨论】: