Autor Beitrag
Wolle92
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: So 22.07.07 11:38 
Hallo,

Ich möchte eine zufällig gewählte Shape-Componente anzeigen lassen, wie kann ich das machen, wenn alle in einer Groupbox liegen?
So wie im Titel funktioniert es nicht (natürlich ist in der eckigen Klammer eine Variable)
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: So 22.07.07 12:15 
Hallo,

ausblenden Delphi-Quelltext
1:
GroupBox1.Controls[x].Visible := True;					

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: So 22.07.07 12:51 
Danke, und wie mache ich das mit
dem ".Brush.Color"?
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 22.07.07 13:08 
FindComponent

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
Lannes
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2352
Erhaltene Danke: 4

Win XP, 95, 3.11, IE6
D3 Prof, D4 Standard, D2005 PE, TurboDelphi, Lazarus, D2010
BeitragVerfasst: So 22.07.07 13:22 
Hallo,

in TControl ist die Eigenschaft Brush noch nicht implementiert, deshalb muss man dem Compiler sagen das das angesprochenne Control die Eigenschaft besitzt. Das realisiert man mit einem sogenannten Typecast.

ausblenden Delphi-Quelltext
1:
TShape(GroupBox1.Controls[x]).Brush.Color := clRed;					

_________________
MfG Lannes
(Nichts ist nicht Nichts) and ('' <> nil ) and (Pointer('') = nil ) and (@('') <> nil )
Wolle92 Threadstarter
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 1296

Windows Vista Home Premium
Delphi 7 PE, Delphi 7 Portable, bald C++ & DirectX
BeitragVerfasst: So 22.07.07 17:07 
ach ja, an die Casts hab ich gar nicht gedacht, danke