Einzelnen Beitrag anzeigen

nahpets
(Gast)

n/a Beiträge
 
#20

AW: D7 FindComponent über .tag und Caption

  Alt 3. Jun 2016, 18:16
Delphi-Quellcode:
var
  i : Integer;
begin
  while not qry.Eof Do begin
    for i := 0 to ComponentCount - 1 do begin
      if not (Component[i] is TPanel) then continue;
      if TPanel(Component[i]).Tag = qry.FieldByName('Spalte1').AsInteger then begin
        TPanel(Component[i]).Caption := qry.FieldByName('Spalte2').AsString;
      end;
    end;
    qry.Next;
  end;
end;
  Mit Zitat antworten Zitat