如何用代码实现判断很多个edit不为空?

来源:百度知道 编辑:UC知道 时间:2024/09/22 02:06:41
一般的判断edit不为空,是一个一个的判断,但是我的edit实在是很多,有什么方法能直接判断出呢?
一般的判断如下:
if (edit1.text<>'') and (edit2.text<>'') and........(edit20<>'') then
begin

end;
太麻烦了。有什么简便的方法吗?

把Edit们放在一个Group控件中,使用同类循环进行判断

写个FOR循环不就完了
isKong= false;
for i=1 to 20
if ("edit"+cstr(i)).text ="" then
isKong=false
else
isKong = true
end if
next

if isKong then
"提交"
else
"不提交"
end if