Einzelnen Beitrag anzeigen

Christian18

Registriert seit: 9. Dez 2003
Ort: Hamburg
1.279 Beiträge
 
#1

Suche Basisklasse, um Quellcode zu sparen

  Alt 16. Okt 2007, 12:05
Hallo,

gibt es eine Art Basisklasse, damit ich nicht jedes Element extra ansprechen muss?

Delphi-Quellcode:
      // TGroupBox
      if Form.FindComponent(Node.Attributes['Name']) is TGroupBox then
        begin
          (Form.FindComponent(Node.Attributes['Name']) as TGroupBox).Caption:=Node.Attributes['Caption'];
        end;
      // TLabel
      if Form.FindComponent(Node.Attributes['Name']) is TLabel then
        begin
          (Form.FindComponent(Node.Attributes['Name']) as TLabel).Caption:=Node.Attributes['Caption'];
        end;
      // TBitBtn
      if Form.FindComponent(Node.Attributes['Name']) is TBitBtn then
        begin
          (Form.FindComponent(Node.Attributes['Name']) as TBitBtn).Caption:=Node.Attributes['Caption'];
        end;
  Mit Zitat antworten Zitat