Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   GUI-Design mit VCL / FireMonkey / Common Controls (https://www.delphipraxis.net/18-gui-design-mit-vcl-firemonkey-common-controls/)
-   -   Delphi Problem mit FindComponent (https://www.delphipraxis.net/18556-problem-mit-findcomponent.html)

Hansa 20. Mär 2004 21:15


Problem mit FindComponent
 
Hi,

ich habe eine größere Form. Eine Gruppe Labels muß ich einer Sonderbehandlung unterziehen. Ungefähr so :

Delphi-Quellcode:
          for i := 8 to 9 do
            TLabel (FindComponent ('Label'+IntToStr(i))).Caption := 'X';
In diesem Falle sind es für Testzwecke 2 Labels. Die heißen Label8 und Label9. Wieso wird kein X angezeigt ?

mirage228 20. Mär 2004 21:18

Re: Problem mit FindComponent
 
Delphi-Quellcode:
  for i := 8 to 9 do
    TLabel(MainForm.FindComponent ('Label'+IntToStr(i))).Caption := 'X';
... vielleicht? (MainForm durch den Namen des Parents des Labels ersetzen)

mfG
mirage228

Christian Seehase 20. Mär 2004 21:20

Re: Problem mit FindComponent
 
Moin Hansa,

funktioniert doch einwandfrei. :gruebel:

Hansa 21. Mär 2004 15:20

Re: Problem mit FindComponent
 
Dubioser Effekt. Wenn man die Form für Findcomponent explizit angibt, geht es immer. Ansonsten nur manchmal. :shock: Einen Zusammenhang kann ich nicht erkennen.


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:15 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz