Convert a screen-coordinates position to grid control's 0-offset row/column index.
bool FindCell( int nx, int ny, int & nRow, int & nCol )
false if the position is not in grid otherwise true
Example codes can be added to GridControl's examples to run
ON_CONTEXTMENU(OnRightClick) //add to class GridCtrlDLG's Message Map //add in class GridCtrlDLG BOOL OnRightClick(UINT nResIDCtrl, int nx, int ny) { if(IDC_GRID == nResIDCtrl) { int nRow, nCol; if( m_GridCtrl.FindCell(nx, ny, nRow, nCol) ) printf("nRow=%d, nCol=%d\n", nRow, nCol); else out_str("not in grid"); } return true; }
GridControl::GetSelCell
GridControl.h