#934 – TextBox Has Built-In Undo Functionality

The TextBox control in WPF has built-in Undo and Redo functionality, allowing you to undo changes to the content of the TextBox or to re-apply (redo) changes that you’ve undone.

Assume that you have a TextBox with some text:


Now assume that you double-click to select the first word and then press Delete to delete it.


Do this two more times, so that you’ve delete the first three words of the text, one at a time.


You’ve now made three distinct changes to the text in the TextBox, one at a time.  You can delete the most recent change by pressing Ctrl+Z, which executes an undo operation.  This will restore the word that was most recently deleted.


You can press Ctrl+Z two more times, restoring the other words that you deleted.


You can redo a change (e.g. delete a word) by pressing Ctrl+Y.



About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: