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

# TCustomGrid.ScrollBarShow

Displays or hides scroll bar(s) for the grid control.

## Declaration

Source position: grids.pas line 1181

`protected procedure TCustomGrid.ScrollBarShow(`
`Which: Integer;`
`aValue: Boolean`
`);`

## Arguments

`Which` |  | Scrollbar(s) affected in the method.
`aValue` |  | True indicates the scroll bar(s) are visible.

## Description

ScrollBarShow is a procedure used to control the visibility of the scroll bars for the grid.

Which is an Integer argument that specifies the scroll bar(s) affected in the method, and can include the following constant values:

SB_HORZ
  Horizontal scroll bar
SB_VERT
  Vertical scroll bar
SB_BOTH
  Both horizontal and vertical scroll bars

aValue is a Boolean argument that indicates if the specified scroll bar(s) are visible or hidden. When aValue contains True, the corresponding scroll bar(s) are displayed. Otherwise, they are hidden.

No actions are performed in the method if a handle has not been allocated for the grid (HandleAllocated returns False). ScrollBarShow ensures that gfUpdatingScrollbar is included in the grid flags prior to calling the ShowScrollBar routine in the LCL interface. The flag value is removed immediately after updating the scroll bar display. Internal members used to track scroll bar visibility are set to the state requested in AValue.

ScrollBarShow is called from the UpdateHorzScrollBar and UpdateVertScrollbar methods, as well as the private UpdateSBVisibility method.

## See also

TGridFlags |  | Set type used to store TGridFlagsOption enumeration values.
TGridFlagsOption |  | Represents state flags used in a grid control.
TWinControl.HandleAllocated |  | Checks whether a handle for the widget has been allocated for the control.
ShowScrollBar |  | Shows or hides a Scroll Bar.