I need a basic text editor (without bold/italic formatting) but need to support Undo, Redo.
What is the best approach
Hi,
UltraTextEditor support Undo/Redo, just like a regular TextBox control.
It does not support full undo/redo, i could undo only the last action. While in Formatted Text I could un-do many of the last actions.
UltraTextEditor did not seem to support Undo more than the regular Text Box control (or the Notepad).
By the way, when the focus is set to the text editor, and when focus is set to some other control, the font size in the editor is different. As soon as focus changes the fonts change - that makes it look odd.
And there is Undo() function which only works for last operation. There is no Redo() function.
And how can I achieve full undo-redo with this control?
Undo/Redo is only supported for a single operation, just like the TextBox control. If you want more than on operation, then you would have to implement that yourself. You can also Submit a feature request to Infragistics and maybe a more robust undo/redo feature will be added to some future version of the controls.
csmpiyush said:By the way, when the focus is set to the text editor, and when focus is set to some other control, the font size in the editor is different. As soon as focus changes the fonts change - that makes it look odd.
The font is not changing, but what happens is that when you go into edit mode, the control displays a Windows TextBox over itself which uses GDI text rendering (which is what Windows uses natively) instead of GDI Plus (which is what DotNet control use by default). My advice is to set the TextRenderingMode on the UltraTextEditor to GDI and then it will always use GDI and there will be no text shifting.