我的窗体上有70个Edit控件,怎样判断它们的Text属性都不为空?难道要and +and 的一个一个加下去?

yundou 2003-10-15 03:02:14
我的窗体上有70个Edit控件,怎样判断它们的Text属性都不为空?难道要and +and 的一个一个加下去?
...全文
44 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
wlmmlw 2003-10-16
  • 打赏
  • 举报
回复
有必要搞这么多个EDIT吗?
mestars 2003-10-16
  • 打赏
  • 举报
回复
这个窗口够大 *_*
gdwyh 2003-10-15
  • 打赏
  • 举报
回复
同意一楼
tncboy 2003-10-15
  • 打赏
  • 举报
回复
收了!!
hanly2008 2003-10-15
  • 打赏
  • 举报
回复
我更晚了~~~
47522341 2003-10-15
  • 打赏
  • 举报
回复
来晚了;^_^
huaervvhuaer 2003-10-15
  • 打赏
  • 举报
回复
function Tform1.isnotnull():boolean;
var
I: Integer;
begin
for I := 0 to ComponentCount - 1 do
if Components[I] is TEdit then
if TEdit(Components[I]).Text = '' then
begin
result:=false;
exit;
end;
result:=true;
end;
noil0125 2003-10-15
  • 打赏
  • 举报
回复
var
I,count: Integer;
begin
count:=0;
for I := 0 to ComponentCount - 1 do
if Components[I] is TEdit then
if TEdit(Components[I]).Text <> '' then
inc(count);
if count=70 then
//70个Edit控件,它们的Text属性都不为空要经常的操作
end;
myfine 2003-10-15
  • 打赏
  • 举报
回复
用一个循环
tanqth 2003-10-15
  • 打赏
  • 举报
回复
就是楼上的办法
飛無痕 2003-10-15
  • 打赏
  • 举报
回复
var
I: Integer;
begin
for I := 0 to ComponentCount - 1 do
if Components[I] is TEdit then
if TEdit(Components[I]).Text <> '' then
begin
ShowMessage(Components[I].Name + ' is not null.');
Abort;
end;
end;

1,183

社区成员

发帖
与我相关
我的任务
社区描述
Delphi Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧