Hi Team,
I am using UltraWinTree and facing following issue.
I am using UltraFormattedTextEditor in the UltraWinTree as I need to format the tree node text. But while editing the tree node, the text is getting truncated at the end. Please refer below screenshot. The font I need to use is Tahoma with font size 10.
Can you please help me in this.
Thanks
- Kaustubh
Hello Kaustubh,
Below I am sending all of the properties that I am applying on the UltraTree and on the UltraFormattedTextEditor:
var ovr = this.ultraTree1.Override; ovr.ActiveNodeAppearance.BackColor = SystemColors.Highlight; ovr.ActiveNodeAppearance.ForeColor = SystemColors.HighlightText; ovr.NodeAppearance.FontData.Name = "Tahoma"; //ovr.NodeAppearance.FontData.SizeInPoints = 10; ovr.LabelEdit = DefaultableBoolean.True; ovr.UseEditor = DefaultableBoolean.True; ultraFormattedTextEditor1.TextRenderingMode = TextRenderingMode.GDI; ultraFormattedTextEditor1.Appearance.FontData.Name = "Tahoma"; ultraFormattedTextEditor1.Appearance.FontData.SizeInPoints = 10;
Please let me know if have any questions or concerns.
Regards,
Ivan Kitanov
Hi Ivan,
Thanks you for your continuous support.
I tried without setting the SizeInPoints, but still not getting the font you were getting in your last reply. Please refer following screenshot. Am I missing any other property to set.
Property of the ultratree:
Thanks!
Kaustubh
The issue with the font might be coming from the fact that GDI+ text will scale linearly in the sense that doubling the height will double the width, however when using GDI. GDI text does not scale linearly, because it tries to make text look better when rendered at a resolution on the order of its stroke width. If you double the height of a GDI font, the width may not exactly double.
Additionally, I have tested the font changes when the OverrideNodeAppearance.FontData.SizeInPoints is not set in design or run-time and the font is looking as expected. I am attaching a screenshot that demonstrates the difference.
With OverrideNodeAppearance.FontData.SizeInPoints:
Without it:
Please consider this approach and let me know if have any questions or concerns.
Regards, Ivan Kitanov
Thanks again for your reply.
I already tried to set it to GDI. It renders the text properly but it also increases the font size. If you refer to my initial post I need the Font Tahoma with size 10. Following is the screenshot with TextRenderingMode = Default (Left Side Tree) and with TextRenderingMode = GDI (Right Side Tree).
I also tried with setting the font name and font size of UltraFormattedTextEditor to Tahoma and 10 but same result.
Your help is much appreciated.
Warm Regards,
Kaustubh Wadi
The issue with truncating the text might be coming from the difference between GDI, which is what the MS TextBox uses, and GDI+, which is what our editors use when not in edit mode. You can easily test this by setting the TextRenderingMode on theUltraFormattedTextEditor to GDI. This could be done with the following code:
ultraFormattedTextEditor1.TextRenderingMode = TextRenderingMode.GDI;
Please let me know if you need any further assistance.
Regards,Ivan Kitanov