在面板或表单上设置组件可见属性

时间:2013-04-06 05:54:25

标签: delphi

如何从表单或面板中获取所有组件并将visible属性设置为false?

   ///  
   ///    loop all components, this is just an idea for the solution ,,,,
   ///

   for i:= 0 to myPanel.ComponentsList do
        begin

        ///

        MyComponent.visible := false; 


        end;

1 个答案:

答案 0 :(得分:3)

为此目的使用Controls数组。

例如:

for I := 0 to Panel1.ControlCount - 1 do
  Panel1.Controls[I].Visible := False;
相关问题