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.
Thanks. :)
Sorry to re-open an old problem, but is there any way to set this globally?
All our UltraTextEditor controls are exhibiting this behaviour, and it's a pain to have to set this property on every control. Surely the default behaviour should be to work correctly, i.e. not change font when control enters edit mode.
And which font is correct (i.e. consistent with the labels etc)? The one in edit mode or not edit mode?
Cheers
Boz
What your looking for is:
Infragistics.Win.DrawUtility.UseGDIPlusTextRendering = false;
Documentation about this property can be found here:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2011.1/CLR2.0/html/Infragistics2.Win.v11.1~Infragistics.Win.DrawUtility~UseGDIPlusTextRendering.html
Thank you, that works, however now all our message boxes do not display correctly, presumably because the font sizes are incorrectly calculated?