Why does the spacing of text of an UltraTextEditor change when it is in Edit mode compared to when it isn't? It seems that when the control has focus, an extra pixel of space is created around all the text, moving it slightly to the right, and slightly down. This is more noticeable if there are multiple lines of text.
This is due to the differences in character kerning between GDI and GDI+. The .NET TextBox, which we use in the UltraTextEditor to do the editing, is a wrapper around the old COM TextBox control, which predates GDI+. The native drawing mechanism for .NET is GDI+, which the UltraTextEditor uses when not in edit mode. GDI+, in an effort to maintain "device independence", significantly changed the kerning algorithm, thus producing the difference in spacing with the same font under the different drawing platforms.
You can avoid this behavior by setting the control's TextRenderingMode to 'GDI', or by setting its 'AlwaysInEditMode' property to true.
Hello Brian
if I set the property 'AlwaysInEditMode' , then a ToolTip on the UltraTextEditor will not be displayed.
Is there a workaround for this issue?
Thanks!
Hi Daniel,
You should probably start a new thread, since your question is only marginally related to this thread. But it depends on how you are applying the ToolTip. When AlwaysInEditMode is true, the UltraTextEditor will display a TextBox control on top of itself. So you might have to apply the ToolTip to that TextBox control, instead of to the UltraTextEditor.