问题描述
以编程方式编辑RichTextBox控件的文本(更具体地说,修改选择字体/颜色)似乎在控件的内置undo堆栈中进行跟踪。有没有办法,写我自己的撤消/重做管理器,以防止某些操作/操作添加到撤消堆栈?
Editing a RichTextBox control's text (more specifically, modifying selection font/color) programmatically seems to be tracked in the control's built in undo stack. Is there a way, short of writing my own undo/redo "manager", to prevent certain actions/operations from being added to the undo stack ?
推荐答案
没有cando。最多可以通过发送EM_SETUNDOLIMIT两次来完全刷新撤消栈。 EM_SETTEXTEX提供与ST_DEFAULT标志相同的选项。当然不是你想要的。看看ScintillaNET是一个真正的编辑器。
No cando. At best you can flush the undo stack completely by sending EM_SETUNDOLIMIT twice. EM_SETTEXTEX offers the same option with the ST_DEFAULT flag. Surely not what you want. Look at ScintillaNET for a real editor.
这篇关于防止RichTextBox操作被添加到控件的撤消堆栈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!