vb中 文本框不为空怎么表达

是不是 : Text1.text<>"" 这样表达?
我运行后,说缺少表达式

你的思路对的,但是没有判断,所以没有办法执行。
用If...Then...Else语句

If text1 <> "" Then
End If

如果你需要在判断后进行操作,可以这样
If text1 <> "" Then MsgBox "不为空"

或者这样

If text1 <> "" Then
MsgBox "不为空"
Else
MsgBox "空"
End if
温馨提示:答案为网友推荐,仅供参考
第1个回答  2008-01-09
If text1 <> "" Then MsgBox "这样就不会缺少表达式"
第2个回答  2008-01-11
if ......then

[elseif]

[elseif]

[else]

end if
第3个回答  2008-01-09
if len(text1) then
'不为空
else
'空
end if
第4个回答  2008-01-09
if text1.text <> "" then

end if