Export (0) Print
Expand All
MFC
Expand Minimize

CRichEditCtrl::LineLength 

Retrieves the length of a line in a rich edit control.


int LineLength(
   int nLine = -1 
) const;

Parameters

nLine

Specifies the character index of a character in the line whose length is to be retrieved. If this parameter is –1, the length of the current line (the line that contains the caret) is returned, not including the length of any selected text within the line. When LineLength is called for a single-line edit control, this parameter is ignored.

When LineLength is called for a multiple-line edit control, the return value is the length (in bytes) of the line specified by nLine. When LineLength is called for a single-line edit control, the return value is the length (in bytes) of the text in the edit control.

Use the LineIndex member function to retrieve a character index for a given line number within this CRichEditCtrl object.

For more information, see EM_LINELENGTH in the Platform SDK.

See the example for LineIndex.

Community Additions

ADD
Show:
© 2014 Microsoft