Autor Beitrag
aDm1n
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 37

Win XP
Turbo Delphi Explorer
BeitragVerfasst: Di 15.05.07 13:28 
Hallo Community,
irgendwie funktioniert das bei mir nicht mehr mit FindComponent:

ausblenden Delphi-Quelltext
1:
2:
if TShape(FindComponent('sh_r'+IntToStr(runde)+'_f'+IntToStr(form))).Brush.Color = clWhite then
      TShape(FindComponent('sh_r'+IntToStr(runde)+'_f'+IntToStr(form))).Brush.Color := clRed


Davon hab ich mehrere Zeilen und bei jedem FindComponent heißt es: "Undefinierter Bezeichner". (Turbo Delphi)

Wäre mir neu wenn man da ne Unit einbinden müsste oder so...

Bitte helft mir :) und Danke im Vorraus

_________________
Gruß aDm1n
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 15.05.07 13:37 
Kanns sein, dass du den Code außerhalb von nem Form aufrufst? Dann musst n#ämlich noch der Name des Forms davor.

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
aDm1n Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 37

Win XP
Turbo Delphi Explorer
BeitragVerfasst: Di 15.05.07 13:45 
Oh ja das wars. Danke dir! :)

EDIT: Doch nicht... Wie würde denn dann die Syntax lauten? Mein Form heißt "frm_main"

_________________
Gruß aDm1n
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Di 15.05.07 14:01 
Das wäre dann
ausblenden Delphi-Quelltext
1:
2:
if TShape(frm_main.FindComponent('sh_r'+IntToStr(runde)+'_f'+IntToStr(form))).Brush.Color = clWhite then
      TShape(frm_main.FindComponent('sh_r'+IntToStr(runde)+'_f'+IntToStr(form))).Brush.Color := clRed

_________________
I thought what I'd do was, I'd pretend I was one of those deaf-mutes.
aDm1n Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 37

Win XP
Turbo Delphi Explorer
BeitragVerfasst: Di 15.05.07 14:04 
AAhh. ja. Jetzt gehts wirklich. Danke.