他的意思大概是当9个Edit均为空时,Form关闭:
响应所有Edit的OnChange事件。以Edit1为例:
procedure TForm1.Edit1Change(Sender: TObject);
var
I,K: Integer;
begin
K:=0;
for I := 0 to ComponentCount - 1 do
if (Components is TEdit) then
if TEdit(Components).Text = '' then K:=K+1;
Label1.caption:=inttoStr(K);
if K=9 then
begin
Close;
Release;
end;
end;