Autor Beitrag
jjturbo
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Mo 16.05.11 11:12 
Moin Forum,

wie kann ich einem TPanel ein OnPaint Ereignis hinzufügen?

Gruß Oliver

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19336
Erhaltene Danke: 1751

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 16.05.11 11:20 
Da hast du etwas falsch verstanden: Ein Panel ist zur Gruppierung von Controls gedacht, mehr nicht. Theoretisch kannst du vermutlich WM_PAINT abfangen oder Paint überschreiben, aber wozu?

Zum Zeichnen in OnPaint eignet sich z.B. eine TPaintBox.
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Mo 16.05.11 11:46 
Habe ein älteres Projekt, mit einer eigenen Kompo, abgeleitet von TPanel. Wollte da jetzt draufzeichnen, ohne all zu viel ändern zu müssen.

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19336
Erhaltene Danke: 1751

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Mo 16.05.11 11:54 
Das ist zwar ein ungünstiger Vorfahr, aber wenn du davon abgeleitet hast, kannst du einfach wie schon nebenbei erwähnt Paint überschreiben. Das siehst du ja auch in dem Quelltext von TCustomPanel in der ExtCtrls.pas:
ausblenden Delphi-Quelltext
1:
2:
  protected
    procedure Paint; override;
jjturbo Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 516

Win2000 prof., WinXP prof.
D4 Stand., D5 Prof, D7 Prof, D2007 Prof.
BeitragVerfasst: Mo 16.05.11 15:11 
Ok, danke :)

_________________
Windows XP: Für die einen nur ein Betriebssystem - für die anderen der längste Virus der Welt...