I know how to draw shapes during a StringGrid.OnDrawCell event (by calling methods of a TCanvas object). When I do so, however, my UI constantly flickers and consumes memory as the draw event fires over and over.
The lines causing the flickering say things like ‘if [condition1 for a given cell=true] then [draw a red circle in the cell].’ (I can post the actual code, if desired.)
So, is it possible a custom method can do the same thing–tell a grid to draw a circle in a cell if a statement resolves to true?
If you haven’t already, set
DoubleBufferedto true. This causes all of the drawing to be done on an off-screen bitmap, and then the entire bitmap is drawn at once. It usually eliminates the flickering.As far as custom methods to do the cell drawing,
OnDrawCellis the custom method. 🙂