Edit::ReplaceSel

Description

Replaces the current selection in this Edit control with specified text.

Syntax

void ReplaceSel( LPCTSTR lpcszNewText, BOOL bCanUndo = FALSE )

Parameters

lpcszNewText
Pointer to a null-terminated string containing the replacement text.
bCanUndo
To specify that this function can be undone, set the value of this parameter to TRUE. The default value is FALSE.

Return

void

Examples

EX1

#include <..\OriginLab\DialogEx.h>

#define IDC_EDIT1 1001

void Edit_ReplaceSel(Dialog& MyDlg)
{
        Edit ed = MyDlg.GetItem(IDC_EDIT1);
        ed.SetSel(32000, 32000); // move to end of all text
        string str = "Sample";
        ed.ReplaceSel(str);
}

Remark

See Also

Edit::SetSel

header to Include

Control.h