如何知道哪些控件类是否具有某一个属性(如具有Caption属性的控件有: TButton,TPanel,TCheckBox). 如我把所有具有Caption的控件类先放在一个数组内, 然后在遍历窗体上的所有控件. 如然后判断这个当前遍历的控件是否在数组内.如果在. 如果在就设置它的Caption为"Caption".(不能分开(即不能像这样 TButton(components[i]).caption :='caption',TPanel(components[i]).caption :='caption'....这样一个个强制转换. 我需求一个语句来实现. 也不能用CASE. 我需要一个通用的.不知道是不有这样的类或方法. 
类似于如下代码(但代码通不过,有错,大概意思是这样)
implementation{*.res} var   Class_lib: array[0..3] of TClass  = (TButton,TPanel,TSpeedButton,TToolButton);
procedure TForm1.Button1Click(Sender: TObject);
var
    i,j:integer;
    ObjType :TClass;
  begin
    for i:= componentcount-1 downto 0 do
    begin
        if components[i] is TObject then
        begin
         Objtype := Components[i].classtype;
         // Listbox1.Items.Add(Tobject(Components[i]).ClassName);
          for j := low(Class_lib) to High(Class_lib) do
          if(class_lib[j] = Objtype) then
          begin
           // Listbox1.Items.Add(Tobject(Components[i]).ClassName);
            Class_lib[i](Components[i] as Class_Lib).Caption := 'Caption';
          end;
        next;       end;
    end;
end;如有不明,可跟我交流. msn :[email protected], QQ :272762202