通过RTTI (Runtime Type Information)可以很方便的操作Delphi控件。

比如已知控件名称访问控件:

var 
  Panel: TComponent;
begin
  Panel := FindComponent("pnlToolbar");
  If Panel is TPanel then
    TPanel(Panel).Color := clSilver;
end;

相关文章:

  • 2022-12-23
  • 2021-10-09
  • 2022-01-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2022-12-23
猜你喜欢
  • 2022-01-04
  • 2022-12-23
  • 2021-12-14
  • 2021-07-31
  • 2022-12-23
  • 2022-12-23
  • 2021-05-23
相关资源
相似解决方案