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

# TCustomDBGrid.WMVScroll

Handles the LM_VScroll message for the control.

## Declaration

Source position: dbgrids.pas line 508

`protected procedure TCustomDBGrid.WMVScroll(`
`var Message: TLMVScroll`
`); message;`

## Arguments

`Message` |  | Window message examined and handled in the method.

## Description

WMVScroll is a method used to handle a LM_VScroll message for the control. It ensures that the dataset for control is repositioned for the window message. No actions are performed in the method if the DataLink for the control is not active.

WMVScroll checks the ScrollCode member in Message to determine the actions performed in the method. The following scroll code values are handled:

SB_TOP
  Moves the dataset in DataLink to the first row.
SB_BOTTOM
  Moves the dataset in DataLink to the last row.
SB_PAGEUP
  Moves the dataset in DataLink towards the beginning of the file. VisibleRowCount contains the number of rows.
SB_LINEUP
  Moves the dataset in DataLink towards the beginning of the file by one row.
SB_LINEDOWN
  Moves the dataset in DataLink towards the end of the file by one row.
SB_PAGEDOWN
  Moves the dataset in DataLink towards the end of the file. VisibleRowCount contains the number of rows.
SB_THUMBPOSITION
  Repositions the dataset in DataLink when the thumb bar position for the control has been changed.
SB_THUMBTRACK
  Repositions the dataset in DataLink when thumb bar tracking has been enabled in the Options for the control. No actions are performed if the dataset is not sequenced, the message has already been handled for the SB_THUMBPOSITION scroll message, or thumb bar tracking has not been enabled in options.

Other scroll code values in Message are ignored.

WMVScroll calls ScrollBarPosition to update the position for the vertical scroll bar on the control. If EditorMode is enabled, the private RestoreEditor method is called to toggle the value in EditorMode and redraw the editor control.

## See also

TCustomDBGrid.DataLink |  | Datalink for the component with event handlers for the linked dataset.
TCustomDBGrid.WndProc |  | Extends the message processing loop for the database grid control.
TCustomGrid.WMVScroll |  | Handles the system message for vertical scrolling.
TCustomGrid.ScrollBarPosition |  | Sets the position for the specified scroll bar to the given value.
TCustomGrid.EditorMode |  | True when the Editor is ready to modify the value for the current cell.
TCustomGrid.WndProc |  | Extends the message processing loop for the grid control.