Einzelnen Beitrag anzeigen

TiGü

Registriert seit: 6. Apr 2011
Ort: Berlin
3.058 Beiträge
 
Delphi 10.4 Sydney
 
#2

AW: TList 10.1 Berlin vs 10.3 Rio

  Alt 18. Aug 2020, 11:55
Mach doch ne generische elements : TList<TControl>; draus;

Delphi-Quellcode:
procedure Tfrm_Umsatz_Statistik.GUIUmsatzMitKunde(_visible: boolean);
var
  Controls: TList<TControl>;
  Control: TControl;
begin
  Controls := TList<TControl>.Create;
  try
    Controls.Add(Label3);
    Controls.Add(lblDatumUnbestimmt);
    Controls.Add(ChkBoxDatumsbereich);
    Controls.Add(chkBoxGattungSelect);
    Controls.Add(lblTitelGattung);
    Controls.Add(ChkBoxAlleGattung);
    Controls.Add(Label7);

    for Control in Controls do
    begin
        Control.Visible := _visible
    end;
  finally
    Controls.Free;
  end;
end;
  Mit Zitat antworten Zitat