natashaXXX
Programmer
I want an "undo" menu option on a text editor. I have no problem undoing key strokes, eg. After using backspace key or keying in characters, and then using my mnuEUndo option, but if the user decides to use mouse to select text, then menu option EditCut, and then I use the undo button it doesn't work. Any ideas.
Code for mnuEUndo:
Dim retval As Long ' return value
retval = SendMessage(MDIForm1.ActiveForm.txtNote.hWnd, EM_UNDO, ByVal CLng(0), ByVal CLng(0))
Code for mnuECut:
Clipboard.SetText MDIForm1.ActiveForm.txtNote.SelText 'put selected text in clipboard
MDIForm1.ActiveForm.txtNote.SelText = "" 'remove selected text
Code for mnuEUndo:
Dim retval As Long ' return value
retval = SendMessage(MDIForm1.ActiveForm.txtNote.hWnd, EM_UNDO, ByVal CLng(0), ByVal CLng(0))
Code for mnuECut:
Clipboard.SetText MDIForm1.ActiveForm.txtNote.SelText 'put selected text in clipboard
MDIForm1.ActiveForm.txtNote.SelText = "" 'remove selected text