Autor Beitrag
Andreas_Sans
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 76



BeitragVerfasst: Mi 04.06.03 18:06 
Ich will FindComponent in einer Procedure benutzen, aber er schreibt mir dann FindComponent wäre ein undefinierter Bezeichner. Gibt es noch eine andere FindComponent-Funktion die auch in Procedures funktioniert ?
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 04.06.03 18:30 
Poste mal bitte Deine Prozedur. Ich ahne, wo Dein Fehler liegt.

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
fcg
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 360

WinXP
D3 Prof, D6 Pers
BeitragVerfasst: Mi 04.06.03 19:17 
hi

du könntest deine Komponenten in einem Array erstellen, und mit dem jeweiligenIndex dann hinter daraufzugreifen...

z.B:

ausblenden Delphi-Quelltext
1:
 myImage[4].Visible := False;					


Weiß aber nicht,ob das dein Problem löst...

fcg

_________________
.: Wer für alles offen ist, kann nicht ganz dicht sein! :.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Mi 04.06.03 19:21 
Ich schätze, ganz einfach, dass die Prozedur so deklariert ist, dass sie nicht zu Form1 gehört, sondern "unabhängig" ist. Also nicht.

"procedure TForm1.MyProz;"
sondern
"procedure MyProz;"

Dann kennt er das isolierte FindComponents nicht (macht ohne Objektbezug ja auch keinen Sinn) und es muss mit Form1.FindComponents aufgerufen werden.

MfG,
Peter

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".