RichEdit::LineLength

Description

Retrieves the length of a given line in this RichEdit control.

Syntax

int LineLength( int nLine = -1 )const

Parameters

nLine

Return

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

Call this function to retrieve the length of a line in a RichEdit control.

Examples

EX1

#include <..\OriginLab\DialogEx.h>
#define IDC_RICHEDIT1 1001

void RichEdit_LineLength(Dialog& EditBoxes)
{
        RichEdit richEdit = EditBoxes.GetItem(IDC_RICHEDIT1);
        int ii, nLineLength;
        int nLineCount = richEdit.GetLineCount();
        string strText;
        for (ii = 0; ii < nLineCount; ii++)
        {
                nLineLength = richEdit.LineLength(ii);
                strText = richEdit.GetLine(ii);
        }
}
/*   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.
*/

Remark

See Also

header to Include

Control.h