S
Steve
Does anyone have information regarding programming methods
used to include 'UNDO' functionality into a simple editor?
used to include 'UNDO' functionality into a simple editor?
Erik Frey said:If you aren't looking for multiple levels of undo, you can take
advantage of the built-in undo handling that many controls already catch,
with the WM_UNDO message. I wrote this in VB.NET but I'll convert a couple
of lines to C# for you (untested!):
First, import sendmessage:
[DllImport("user32.dll", EntryPoint = "SendMessageA")]
public static extern uint SendMessage(IntPtr hWnd, uint wMsg,
uint wParam, uint lParam);
Also, declare:
public const int WM_UNDO = 0x304;
Then, test this anywhere in your windows forms code:
SendMessage(this.ActiveControl.Handle, WM_UNDO, 0, 0)
A bit of a hack, but it gets the job done if you want something
simple!
Erik
Steve said:Does anyone have information regarding programming methods
used to include 'UNDO' functionality into a simple editor?