RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDBCtrlGrid.OnPaintPanel Event

Occurs when TDBCtrlGrid needs to draw a panel in the grid.

Pascal
property OnPaintPanel: TPaintPanelEvent;
C++
__property TPaintPanelEvent OnPaintPanel;

Write an OnPaintPanel event handler to customize the drawing of a panel in the TDBCtrlGrid object. TDBCtrlGrid paints the background using the Color or SelectedColor property, including the raised border if it is specified by the PanelBorder property. Then the OnPaintPanel event occurs to allow an event handler to add to the image of the panel. 

The DBCtrlGrid parameter is the grid that contains the panel. The Index parameter is the index of the panel being painted, where 0 is the first panel, 1 is the second panel, and so on. Use the PanelIndex property to determine whether the panel being drawn is selected. 

Use the Canvas property to paint the panel. The point (0,0) on the canvas is the upper left corner of the panel, and the point (PanelWidth, PanelHeight) is the lower right corner. 

Controls placed on the panel are drawn separately and do not need to be drawn in an OnPaintPanel event handler. 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!