Autor Beitrag
Fabian E.
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: Sa 13.01.07 17:08 
hi!
hab ma ne frage: wie kann ich wenn ich sehr vieln panels meine eigene OnClick prozedur zuweise mit der variable sender arbeiten?
Z.B. würde ich gerne die Farbe des angeklickten Panels ändern. Aber Sender.Color oder so geht leider nicht...
Wie kann ich heraus finden "wer" der sender ist?gibt es einen art cast wie objToStr oder so?

vielen dank schon mal!

Fabi
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Sa 13.01.07 17:13 
TPanel(Sender).Color ;-)
Sender ist vom Typ TObject, wovon TPanel abgeleitet ist. TObject kennt Color aber nicht.
Deshalb musst du Delphi sagen, dass das ein Panel ist.
Fabian E. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 554

Windows 7 Ultimate
Visual Studio 2008 Pro, Visual Studion 2010 Ultimate
BeitragVerfasst: Sa 13.01.07 17:21 
ok! danke das klappt!^^
Fabi