[Lazarus] DBGrid highlighting certain cells

Andrea Mauri andrea.mauri.75 at gmail.com
Fri Jan 22 09:52:48 CET 2010


Il 22/01/2010 8.34, Jesus Reyes ha scritto:
> Using OnPrepareCanvas you don't have to draw anything, you get the column:tcolumn which is being painted as an argument and from there you get the field and can take decisions based on fields value, then you change dbgrid's canvas properties, for cell background you will have to adjust grid.canvas.brush.color, font changes can be made on grid.canvas.font, alignment, etc.

I use OnPrepareCanvas in order to change color background and fonts of a 
grid. I encunter a problem with the font. I can set the font color but 
the Bold property does not work, any hint?
this is the code:

Canvas.Font.Bold:= True;
Canvas.Font.Color:= clSkyBlue;

The font are correctly drawn in clSkyBlue but are not set to bold.
andrea




More information about the Lazarus mailing list