RichEdit::SetSel

Description

Sets the selection in this RichEdit control.

Syntax

void SetSel( long nStartChar, long nEndChar )

Parameters

nStartChar
Zero-based index of the first character
in the current selection.
nEndChar
Zero-based index of the last character
in the current selection.

Return

void

Examples

EX1

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

void RichEdit_SetSel(Dialog& EditBoxes)
{
        RichEdit richEdit = EditBoxes.GetItem(IDC_RICHEDIT1);
        // Select the character between 0 and 10
        richEdit.SetSel(0, 10);
        long nStartChar, nEndChar;
        richEdit.GetSel(nStartChar, nEndChar);    
        ASSERT(0 == nStartChar && 10 == nEndChar);
}

Remark

See Also

RichEdit::GetSel

header to Include

Control.h