想实现光标离开代码后满足条件则计算出来值,不满足条件则用手动输入值作为控件值,代码如下,如果没有else则可以计算,但有了Else
e.Form.controls("NumericComboBox5").ReadOnly=False 反而出错,请问是什么原因?
If e.Form.controls("combobox7").value="元每吨" And e.Form.controls("combobox8")="差价" Then
Dim N2 As Double=e.Form.controls("NumericComboBox2").value
Dim N4 As Double=e.Form.controls("NumericComboBox4").value
Dim N1 As Double=e.Form.controls("NumericComboBox1").value
e.Form.controls("NumericComboBox5").value=(N2-N4)*N1
Else
e.Form.controls("NumericComboBox5").ReadOnly=False
End If
谢谢!