Vcl.DBCGrids.TDBCtrlGrid.OnPaintPanel

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnPaintPanel: TPaintPanelEvent read FOnPaintPanel write FOnPaintPanel;

C++

__property TPaintPanelEvent OnPaintPanel = {read=FOnPaintPanel, write=FOnPaintPanel};

Properties

Type Visibility Source Unit Parent
event published
Vcl.DbCGrids.pas
Vcl.DBCGrids.hpp
Vcl.DBCGrids TDBCtrlGrid

Description

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

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.

See Also