I'm trying to write a custom draw cell method for a TDBGridEh. The problem is when I change properties of pen, brush, ... the painting becomes messy. That's because the control does some extra painting itself after it calls the event handler. So I have to keep all props and then reset them when my own painting was finished.
I tried to create my own TControlCanvas and assign grid's one to it, but I get a run-time exception with message:
Cannot assign a TControlCanvas to a TControlCanvas
, that indicates the AssignTo method is not implemented for TControlCanvas nor for its ancestors. So my questions are:
Why
TControlCanvasdoes not have anAssignTomethod? What is the problem?How can I keep and restore all properties of a TControlCanvas? And by that I mean something more convenient than creating
TPen,TBrush,TFont, etc. .