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

  • Format:

  • DT_LEFTleft aligned

  • DT_CENTERcentered

  • DT_RIGHTright aligned

  • DT_TOPtop aligned

  • DT_VCENTERvertically centered

  • DT_BOTTOMbottom aligned

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