有没有办法检查两个文本框(用户名,密码)是否有文本?我想在启用连接按钮之前检查一下。
我尝试使用两个 if 语句,例如
if not user.text = "" then
buttonlogin.enabled = true
end if
if not password.text = "" then
buttonlogin.enabled = true
end if
但是如果其中一个按钮获得文本而不是两者都获得文本,则该按钮将被启用。
谢谢你。 :)
尝试
if string.IsNullOrEmpty(strings.trim(user.text)) then
buttonlogin.enable = false
else
buttonlogin.enable = true
endif
密码也一样。