for i:=0 to TForm(Sender).ControlCount-1 do
 begin
 //如果 TForm(Sender).Controls[i] 是从TWinControl继承下来的...
 end;
 这句怎么写呀?

解决方案 »

  1.   

    for i:=0 to TForm(Sender).ControlCount-1 do
     begin
       if TForm(Sender).Controls[i] is TWinControl then
         { TODO }
     end;
      

  2.   

    TForm(Sender).Controls[i] is TWinControl
      

  3.   

    TForm(Sender).Controls[i].InheritsFrom(TWinControl)...
      

  4.   

    for i:=0 to self.ControlCount-1 do
      begin
        if self.Controls[i] is TWinControl then
          showmessage(self.Controls[i].ClassName + '是从TWinControl继承来的');
      end;
    试试吧