Vcl.Grids.TCustomDrawGrid.MouseToCell

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

procedure MouseToCell(X, Y: Integer; var ACol, ARow: Longint);

C++

void __fastcall MouseToCell(int X, int Y, int &ACol, int &ARow);

Properties

Type Visibility Source Unit Parent
procedure
function
public
Vcl.Grids.pas
Vcl.Grids.hpp
Vcl.Grids TCustomDrawGrid

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 number of the column over the point (X,Y), and the ARow parameter as the number of the row.

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.

See Also

Code Examples