CRichEditCtx.Undomethod
This message undoes the last edit control operation in the control's undo queue.
Syntax
FUNCTION Undo () AS LONG
FUNCTION Undo (BYVAL Count AS LONG) AS LONG
Parameters
| Name | Description | |
|---|---|---|
Count | The specified number of undo operations. If the value of this parameter is tomFalse, undo processing is suspended. If this parameter is tomTrue, undo processing is restored. |
Return value
First overloaded function: 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.
Second overloaded function: The actual count of undo operations performed. If all of the Count undo operations were performed, it returns S_OK. If the method fails, it returns S_FALSE, indicating that less than Count undo operations were performed.
Description
First overloaded function: Undoes the last edit control operation in the control's undo queue.
Second overloaded function: Performs a specified number of undo operations.
SuspendUndo: Suspends undo processing.
ResumeUndo: Resumes undo processing.
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.
Reference
- Defined in AfxNova/CRichEditCtx.inc:3181
- Documented in Windows/WIndows Controls/RichEdit/CRichEditCtx Class.md
- Topic: CRichEditCtx Class