Undo, Redo, Cut, Copy & Paste

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
 
K

Kevin Spencer

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top