Undo, Redo, Cut, Copy & Paste

  • Thread starter Thread starter Charlie@CBFC
  • Start date Start date
C

Charlie@CBFC

Hi:

How do you implement Undo, Redo, Cut, Copy and Paste functionality within a
WinForm menu? Is there a command or do you have to write it custom? Also,
when doing ctrl+x (cut command) in a WinForm textbox, text is not cut.
Would like to add this functionality to my application.

Thanks,
Charlie
 
You have to "write it custom." Undoing and Redoing mean different things in
different contexts. Basically, you need to keep track of what has happened,
and you may need to keep track of the state before/after the change, and/or
the ClipBoard data, if you're using the ClipBoard. For example, let's say
that the user does the following:

Cut
Paste
Cut
Paste

Note that the second "Cut" overwrites the Clipboard data.

Adobe Photoshop, for example, keeps a copy of the image state prior to each
change made. But again, it's all a matter of what sort of Undo/Redo model
you want to implement, which you will need to define carefully first.

Good luck!

--
HTH,

Kevin Spencer
Microsoft MVP

Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
 
Back
Top