Einzelnen Beitrag anzeigen

nahpets
(Gast)

n/a Beiträge
 
#16

AW: D7 FindComponent über .tag und Caption

  Alt 3. Jun 2016, 17:53
Oder suchst Du sowas? (nicht getestet)
Delphi-Quellcode:
var
   myComp : TComponent;
begin
  while not qry.Eof Do begin
    myComp := FindComponent(Format('Panel%d',[qry.FieldByName('Spalte1').AsInteger]));
    if Assigned(myComp) and (myComp is TPanel) then begin
      TPanel(myComp).Caption := qry.FieldByName('Spalte2').AsString;
    end;
    qry.Next;
  end;
end;
  Mit Zitat antworten Zitat