[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Grids' (#lcl)

# TCustomGrid.DrawBorder

Draws the border for the grid control.

## Declaration

Source position: grids.pas line 1053

`protected procedure TCustomGrid.DrawBorder;`

## Description

DrawBorder is used to draw the border around the grid using the client rectangle for the control. No actions are performed in the method when Flat is set to False or BorderStyle has a value other than bsSingle.

DrawBorder ensures that the Pen color in Canvas is updated to use the value in BorderColor. The width for the Pen is set to 1 pixel for the drawing operation. Drawing methods in Canvas are called to draw the borders on the Left, Right, Top, and Bottom edges for the control.

DrawBorder is called from the Paint method, and occurs after the inherited Paint method and its OnPaint event handler have been executed.

## See also

TCustomGrid.DrawBorder |  | Draws the border for the grid control.
TCustomGrid.BorderStyle |  | Drawing style used for the borders on the control.
TCustomGrid.Flat |  | Indicates if cells are displayed using a Flat appearance.
TCustomGrid.Paint |  | Draws the edges, borders, and rows in the grid control.
TCustomControl.Canvas |  | The drawing surface for the control.
TControl.ClientHeight |  | The height for the client area on the control.
TControl.ClientWidth |  | The width of the client area for the control.