要判斷TextBox1, TextBox3無輸入值, 我使用"<>0"做判斷式, 請問有其他更好的寫法嗎?
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
rpm = Val(TextBox1.Text)
fan = Val(TextBox2.Text)
pk = Val(TextBox3.Text)
n = Val(TextBox4.Text)
If rpm <> 0 Or pk <> 0 Then
Exit Sub
Else
n = pk * 60 / rpm
End If
End Sub作者: bigbrain2 時間: 2017-3-12 09:11