在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
uses TypInfo; function TForm1.SetControlProp(ComStr, value: string): boolean; var ComName, ComProp: string; i: integer; Loop: Integer; PropInfo: PPropInfo; cp: TComponent; begin i := Pos('.', ComStr); if i > 0 then begin ComName := copy(ComStr, 1, i-1); ComProp := Copy(Comstr, i+1, 1000); cp := FindComponent(ComName); PropInfo := GetPropInfo(cp.ClassInfo, ComProp); if Assigned(PropInfo) then SetStrProp(cp, PropInfo, value); end; end; procedure TForm1.Button3Click(Sender: TObject); begin SetControlProp('button1.caption', 'test'); // 設置button1的caption 為 test end;
http://www.cnblogs.com/kfarvid/archive/2009/10/19/1586229.html |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论