How to develop Undo Redo algorith for custom Text Editor using RichTextBox.

  • Thread starter Sakharam Phapale
  • Start date
S

Sakharam Phapale

Hi All,

I am developing my own text editor using RichTextBox control.
I don't want to use RichTextBox Undo and Redo functions. Instead of that I
want to develop my own algorithm for Undo & Redo, as my application demands
it. Because for each word in text, I have associated data and so, require to
maintain state of associated data also.

Currently, I have developed algorithm which works on each key press.
On each key press event, I maintain state of richTextBox text by pushing
action key into stack. On each Undo operation, I pop that key and change the
state of RichTextBox text to previous state.

But, I don't understand how to develop algorithm which works like Microsoft
Word, which doesn't work on character by character basis.
Is it depends on word by word basis or time basis or type of key press
action like Delete, Space, Enter.

Hope that I explain my query reasonably well to understand.

Thanks and Regards,
Sakharam Phapale
 

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