部分程序:
i:=-1;
while i<=FormName.ComponentCount-1 do
begin
if (i=-1) then c:=FormName
else c:=FormName.Components;
cap:='';
if (c is TLabel) then cap:=(c as TLabel).Caption
else if (c is TForm) then cap:=(c as TForm).Caption
else if (c is TButton) then cap:=(c as TButton).Caption
else if (c is TGroupBox) then cap:=(c as TGroupBox).Caption
else if (c is TRadioGroup) then cap:=(c as TRadioGroup).Caption
else if (c is TTransparentButton) then cap:=(c as TTransparentButton).Caption
else if (c is TBitBtn) then cap:=(c as TBitBtn).Caption
else if (c is TDBGrid) then ChangeDBGrid(c as TDBGrid);