![]() |
FindComponent auf andere Unit
Hallo,
Delphi-Quellcode:
geht solange ich eine Komponente (TPanel) aus der aktiellen Unti abfrage. Frage ich jedoch eine Komponente aus einer anderen Unit des Projektes ab:
var acomp : TComponent;
beging for i:=1 to 10 do begin acomp := FindComponent('Panel'+IntToStr(i)); if acomp <> nil then (acomp as TPanel).Color := clRed; end;
Delphi-Quellcode:
bekomme ich immer nil zurück, also die Komonente wird nicht gefunden?
{ incl. Unit-Name }
acomp := FindComponent('Form1.Panel'+IntToStr(i)); Wie kann ich dynamisch auf Komponenten anderer Units zugreifen? Danke jangbu [edit=mkinzler]Delphi-Tags eingefügt Mfg, mkinzler[/edit] |
Re: FindComponent auf andere Unit
FindComponent ist eine Methode deiner Form und hat mit Units eher weniger zu tun.
Delphi-Quellcode:
acomp := Form1.FindComponent('Panel'+IntToStr(i));
|
Re: FindComponent auf andere Unit
Super!
Danke dominikkv jangbu |
Alle Zeitangaben in WEZ +1. Es ist jetzt 04:04 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz