Einzelnen Beitrag anzeigen

mytbo

Registriert seit: 8. Jan 2007
461 Beiträge
 
#8

AW: TFindComponent

  Alt 1. Feb 2024, 15:40
for I in TimeList do TListView(SellProductForm.FindComponent(I)).Items.Clear; Das funktioniert. Warum jetzt auch immer .....
Nicht sicher! FindComponent kann Nil oder etwas anderes als ein TListView liefern:
Delphi-Quellcode:
var
  clv: TComponent;
begin
  for s in TimeList do
  begin
    clv := SellProductForm.FindComponent(s);
    if clv is TListView then
      TListView(clv).Items.Clear;
  end;
PS: himitsu hat das in Post 4 schon geschrieben.

Bis bald...
Thomas

Geändert von mytbo ( 1. Feb 2024 um 15:53 Uhr) Grund: Bezug auf Post 4 hinzugefügt
  Mit Zitat antworten Zitat