有三个文件框 text1 text2 text3select case ?这里怎么写(要求文框不能为空为条件)case text1.text msgbox "a" case text2.text msgbox "b" case text3.text msgbox "c"end select这些好像都不行,Not empty, true, not isnull搞不清楚,各位请帮帮忙
为什么不用 if ..... Then ............ elseif ...Then ............. else ............. End if
select case似乎没办法实现你的要求。改用if结构。
判断是否为空可用
If Text1.Text = "" then ' 执行操作 End if 或者 (建议使用下面的方法,因为进行字符串比较需要的处理量甚至比读取属性还要大) If Len(Text1.Text) = 0 then ' 执行操作 End if
select 只返回第一个符合条件的表达式的.select case "" case text1.text msgbox "1" case text2.text msgbox "2" case text3.text msgbox "3" case else msgbox "都不是空" end select
if ..... Then
............
elseif ...Then
.............
else
.............
End if
If Text1.Text = "" then
' 执行操作
End if
或者 (建议使用下面的方法,因为进行字符串比较需要的处理量甚至比读取属性还要大)
If Len(Text1.Text) = 0 then
' 执行操作
End if
case text1.text
msgbox "1"
case text2.text
msgbox "2"
case text3.text
msgbox "3"
case else
msgbox "都不是空"
end select