...
//说明:aPanel为需要感知的TPanel类实例;strlstNames为aPanel上的控件名称;strlstClasses为aPanel上的控件类名
procedure GetComponents(const aPanel: TPanel; var strlstNames: TStringList; var strlstClasses: TStringlist);
var
I: Integer;
begin
strlstClasses.Clear;
strlstNames.Clear;
with aPanel do
begin
for I := 0 to Components.Count - 1 do
begin
strlstClasses.Add(Components.ClassName);
strlstNames.Add(Components.Name);
end;
end;
end;
...