Vcl.Grids.TCustomDrawGrid.OnDrawCell
Delphi
property OnDrawCell: TDrawCellEvent read FOnDrawCell write FOnDrawCell;
C++
__property TDrawCellEvent OnDrawCell = {read=FOnDrawCell, write=FOnDrawCell};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | protected | Vcl.Grids.pas Vcl.Grids.hpp |
Vcl.Grids | TCustomDrawGrid |
Description
Occurs when a cell in the grid needs to be drawn.
Write an OnDrawCell event handler to draw the contents of all the cells in the grid. Draw on the cell using the methods of the Canvas property. The Rect
parameter indicates the location of the cell on the canvas. The Col
and Row
parameters indicate the column and row indexes of the cell that should be drawn. The State
parameter indicates whether the cell has input focus, whether the cell is selected, and whether the cell is a fixed (nonscrolling) cell.
If the OnDrawCell event handler is not assigned, all cells in the draw grid will appear empty. If the DefaultDrawing property is True, the draw grid paints the background color of the cell before the OnDrawCell event, and draws a focus rectangle around the selected cell after the OnDrawCell event handler finishes drawing the contents of the cell. If the DefaultDrawing property is False, the OnDrawCell event handler should paint the background of the cell and provide all visual indication of selection and focus.
See Also
Code Examples