有没有办法为 TextBox 实现 Redo() 函数? C#
Is there a way to implement a Redo() function for TextBox? C#
我对 TextBox
很困惑,因为我习惯于使用 RichTextBox
(我决定切换,因为它看起来更快..)我有一个问题:
与 RichTextBox
不同,TextBox
似乎根本没有 textBox.Redo();
功能。有没有办法为 TextBox
实现 .Redo()
功能,还是不可能?
感谢您的宝贵时间!
在 TextBoxBase.Undo() 中,通过 SendMessage
以 EM_UNDO
作为消息进行调用。
在 the docs 中对于 EM_UNDO
我们可以看到以下内容:
Edit controls and Rich Edit 1.0: An undo operation can also be undone. For example, you can restore deleted text with the first EM_UNDO message, and remove the text again with a second EM_UNDO message as long as there is no intervening edit operation.
因此再次调用 Undo()
将重做。
我对 TextBox
很困惑,因为我习惯于使用 RichTextBox
(我决定切换,因为它看起来更快..)我有一个问题:
与 RichTextBox
不同,TextBox
似乎根本没有 textBox.Redo();
功能。有没有办法为 TextBox
实现 .Redo()
功能,还是不可能?
感谢您的宝贵时间!
在 TextBoxBase.Undo() 中,通过 SendMessage
以 EM_UNDO
作为消息进行调用。
在 the docs 中对于 EM_UNDO
我们可以看到以下内容:
Edit controls and Rich Edit 1.0: An undo operation can also be undone. For example, you can restore deleted text with the first EM_UNDO message, and remove the text again with a second EM_UNDO message as long as there is no intervening edit operation.
因此再次调用 Undo()
将重做。