This topic has not yet been rated - Rate this topic

CEdit::LineLength

Call this function to retrieve the length of a line in an 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.

Return Value

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.

Remarks

Use the LineIndex member function to retrieve a character index for a given line number within a multiple-line edit control.

For more information, see EM_LINELENGTH in the Platform SDK.

Example

See the example for CEdit::LineIndex.

See Also

CEdit Overview | Class Members | Hierarchy Chart | CEdit::LineIndex

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.