![]() |
Ereignisroutine OnDrawCell(...) in eine Komponente auslagern
Hallo,
wie kann ich eine Ereignisroutine OnDrawCell aus dem StringGrid1 eines TForm1
Delphi-Quellcode:
procedure TForm1.StringGrid1DrawCell(Sender: TObject; ACol, ARow: Integer;
Rect: TRect; State: TGridDrawState; Farbe:TColor); begin ... end; in eine von TStringGrid abgeleitete Komponente TEB_StringGrid
Delphi-Quellcode:
verschieben?
TEB_StringGrid = Class(TStringGrid);
... end; Ich möchte nämlich in einer neuen Komponente TEB_StringGrid die Zellfarbgebung und die Typenwandlung von Single in String usw. mit übernehmen Ich habe folgendes Problem dabei: In dem TForm1.StringGrid1 heißt diese Ereignisroutine
Delphi-Quellcode:
aber in der Komponente müßte diese als
TForm1.StringGrid1DrawCell(...)
Delphi-Quellcode:
aufgelöst werden, und dann wäre da noch die Parameterliste.
TEB_StringGrid.DrawCell(..)
Würde dieses der Compiler verstehen? Vielen Dank für Hilfe E. B. |
Re: Ereignisroutine OnDrawCell(...) in eine Komponente ausla
.OnDrawCell ist eine Event-Property, also eine Referenz auf eine Methode, diese Methode ist ja im Standardfall auch keine Methode des Grids sondern der Form.
|
Re: Ereignisroutine OnDrawCell(...) in eine Komponente ausla
Danke, danke!
Ja, und was mache ich da? Gruß eb |
Re: Ereignisroutine OnDrawCell(...) in eine Komponente ausla
Delphi-Quellcode:
bzw. durch Setzen im OI
TEB_StringGrid1.onDrawwCell := Form1.StringGrid1DrawCell;
|
Re: Ereignisroutine OnDrawCell(...) in eine Komponente ausla
Danke,
und TEB_StringGrid1.onDrawwCell kann ich dann im Code der Komponente ausimplementieren? Hmm, in der Komponente habe ich aber keinen OI. Grüße E. B. |
Re: Ereignisroutine OnDrawCell(...) in eine Komponente ausla
In diesem Falle wäre es besser .DrawCellzu Überschreiben.
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:55 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz