Help Center

CRichEdit.Undomethod

This message undoes the last edit control operation in the control's undo queue.

Windowsmethoddocumented

Syntax

FUNCTION Undo (BYVAL hRichEdit AS HWND) AS LONG

Parameters

NameDescription
hRichEditThe handle of the rich edit control.

Return value

For a single-line edit control, the return value is always TRUE.

For a multiline edit control, the return value is TRUE if the undo operation is successful, or FALSE if the undo operation fails.

Description

This message undoes the last edit control operation in the control's undo queue.

Remarks

Edit controls and Rich Edit 1.0: An undo operation can also be undone. For example, you can restore deleted text with the first EM_UNDO message, and remove the text again with a second EM_UNDO message as long as there is no intervening edit operation.

Rich Edit 2.0 and later: The undo feature is multilevel so sending two EM_UNDO messages will undo the last two operations in the undo queue. To redo an operation, send the EM_REDO message.

Rich Edit: Supported in Microsoft Rich Edit 1.0 and later.

Reference

  • Defined in AfxNova/CRichEdit.inc:1345
  • Documented in Windows/WIndows Controls/CRichEdit Class.md
  • Topic: CRichEdit Class