Contents - Index - Previous - Next


MouseToCell method



Applies to
TProfGrid component

Declaration
function MouseToCell(X, Y: Integer; var ACol, ARow: Integer): Boolean;

Description

Returns the column and row of the cell at the position with screen coordinates (X, Y).

Call MouseToCell to convert from grid-relative screen coordinates to row and column indexes. The X and Y parameters are the screen coordinates of the point to be converted. MouseToCell returns the ACol parameter as the index of the visible column over the point (X, Y), and the ARow parameter as the index of the visible row.

Returns True on success. Returns False if there is no cell at the position with screen coordinates (X, Y).

Tip:  Usually the MouseToCell method is used in a mouse event handler, which supplies the mouse coordinates as the X and Y parameters of the method call.