LineIndex
Get index of first character in a line
int LineIndex( int nLine = -1 )const
The character index of the line specified in nLine or -1
if the specified line number is greater then the number
of lines in the edit control.
EX1
#include <..\OriginLab\DialogEx.h> #define IDC_RICHEDIT1 1001 void RichEdit_LineIndex(Dialog& EditBoxes) { RichEdit richEdit = EditBoxes.GetItem(IDC_RICHEDIT1); int nBegin, nEnd; // Replace the second line, if it exists, of the rich edit control // with the text "Origin C". if ((nBegin = richEdit.LineIndex(1)) != -1) { nEnd = nBegin + richEdit.LineLength(1); richEdit.SetSel(nBegin, nEnd); richEdit.ReplaceSel("Origin C"); } }
Control.h