ReplaceSel
Replaces the current selection in this RichEdit control with specified text.
void ReplaceSel( LPCTSTR lpszNewText, BOOL bCanUndo = FALSE )
void
EX1
#include <..\OriginLab\DialogEx.h> #define IDC_RICHEDIT1 1001 void RichEdit_ReplaceSel(Dialog& EditBoxes) { RichEdit richEdit = EditBoxes.GetItem(IDC_RICHEDIT1); richEdit.SetSel(0, -1); string str = "Sample"; richEdit.ReplaceSel(str, FALSE); ASSERT( richEdit.Text == str ); }
RichEdit::SetSel
Control.h