这种验证,不应该针对单个控件, 而是应该在“确定”按钮中统一验证,代码:
Dim v1 As Double = e.Form.Controls("textbox1").value
Dim v2 As Double = e.Form.Controls("textbox1").value
if v1 >0 AndAlso v1<=20 AndAlso v2 >0 Andalso v2 <= 20 And v2 >= v1 Then
'原确定按钮的代码
Else
'MessageBox.show("输入无效")
End if