<< Return to Main Index

< Return to Class Index

GXGetMultiLineTextPosUnderPt

int GXGetMultiLineTextPosUnderPt(CDC* pDC, LPCTSTR lpszString, int nCount, CRect rect, UINT nFormat, CPoint pt);

pDC

Points to the device context.

lpszString

Points to the text to be drawn.

nCount

Specifies the size of the text in bytes. You should pass -1 for a zero-terminated string.

rect

Drawing rectangle.

nFormat

DT_WORBREAKword break

pt

Specifies the point.

Return Value

Returns the zero-based text position for the given point. It is -1 if no text is found at the given point.

Remarks

Computes the text position for a given point. The text size depends on the font selected into the device context.

The grid-component draws all static cells with GXDrawTextLikeMultiLineEdit. In effect, the user sees a normal edit control drawn in the cell. When the user clicks in the cell, the grid-component can compute the text position of the mouse click with GXGetMultiLineTextPosUnderPt, activate the associated Cedit, and position the caret.

See Also

CGXEditControl GXDrawTextLikeMultiLineEdit CGXDrawingAndFormatting

Macros

Class Overview | Class Members