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

# TCustomControlBar.MouseToBandPos

Gets the visible band on the control bar at the specified mouse coordinates.

## Declaration

Source position: extctrls.pp line 1660

`public function TCustomControlBar.MouseToBandPos(`
`X: Integer;`
`Y: Integer;`
`out AGrabber: Boolean`
`):TCtrlBand;`

## Arguments

`X` |  | Horizontal coordinate for the mouse pointer.
`Y` |  | Vertical coordinate for the mouse pointer.
`AGrabber` |  | True if the mouse coordinates are over the grabber decoration on the band.

## Function result

TCtrlBand instance at the specified coordinates, or Nil when the coordinates are not on a visible band.

## Description

MouseToBandPos iterates over the visible bands in the control to find the TCtrlBand instance which is under the coordinates specified in X and Y. The return value is Nil if a band is not found under the specified coordinates.

AGrabber is a Boolean output argument used to indicate whether the coordinates are over the grabber decoration on the control. Its value is False if a band was not found, or the value in Y is greater than the largest bottom property in the list of visible bands.

Perhaps this should have been named MousePosToBand.

## See also

TCustomControlBar.MouseMove |  | Handles a mouse move message including dragging a control band.