Hi does anyone know if it is possible to display a picture as a background to a string grid, Or is anyone aware of any free Grid component that can do this.
Thanks
colin
Hi does anyone know if it is possible to display a picture as a background to a string grid, Or is anyone aware of any free Grid component that can do this.
Thanks
colin
You could use a
TDrawGrid
(or aTStringGrid
), which supports owner-drawing, and dowhere
FBg
is aTBitmap
(in the form class, for instance), and then doSample Screenshot http://privat.rejbrand.se/drawgridbg.png Sample Screenshot http://privat.rejbrand.se/drawgrid2.png Sample Screenshot http://privat.rejbrand.se/drawgrid3.png
While actually answering here the explicit question of rossmcm in his comment to the code of Andreas Rejbrand, it also complements hís answer to the original question.
Drawing the image beyond the grid boundary, but still within the StringGrid control bounds could be achieved as follows:
If you want to draw the image in the cells as well, then combine both techniques. That they do not follow the same approach, for Andreas uses events where I declare a descendant, should not lead to great difficulty with merging.
Yes, it is possible. TStringGrid inherits from TDrawGrid and does all drawing on its own. You can use the OnDrawCell event to do custom drawing.