uses
TypInfo;
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
I: Integer;
begin
//Caption := 'ABC'; //设置窗自身Caption
for I := 0 to ComponentCount - 1 do
if GetPropInfo(Components, 'Caption', [tkString, tkLString, tkWString]) <> nil then //确保Caption属性是string类型
//if GetPropInfo(Components, 'Caption') <> nil then
SetPropValue(Components, 'Caption', 'ABC');
end;
//D7 + WinXP sp2