CGXGridCore::CalcClientColFromPt
ROWCOL CalcClientColFromPt(CPoint& pt, int* xLeft = NULL);
pt
Specifies the x-coordinate of the point.
xLeft
Points to an integer where the method will store the left x-coordinate of the column. If it is NULL, the method will ignore this parameter.
Return Value
The relative index of the column. It is GX_INVALID when no column could be determined at the given point.
Remarks
Determines the column for the point.
Example
This example determines the relative column index and invalidates the window area of this column.
ROWCOL nCol = CalcClientColFromPt(CPoint(x, 0));
if (nCol != GX_INVALID)
CRect r = GetGridRect( );
r.left += CalcSumOfClientColWidths(0, nCol);
InvalidateRect(r);
UpdateWindow( );
}
See Also
CGXGridCore::HitTest CGXGridCore::CalcSumOfClientColWidths