When test trimming is set to anything other than "None" the text in an Editor has a vertical Offset when text is trimmed.
Bug or feature?
If Features: How can I avoid this?
Many thanks.
Urs Scherrer
Hi Urs,
Not really. It's just a different way of drawing text. GDI Plus is the newer DotNet way to draw text. But it has a lot of problems, especially with text measurement and alignment. Newer versions of Visual Studio actually default to the old style (GDI), presumably because of the GDI Plus problems.
So reverting to GDI is a good option and will make your text drawing a lot more consistent and reliable.
Dear Mike
Many thanks for your valuable input.
The original Problem was coming form Ultragrid: Columns with trimmed text beside columns without trimmed text look ugly because text is not on the same height.
I now reactivaed trimming and placed the "UseGDIPlus.." Statement at very first line of Main Window. That works!
Does it have any other effects I should observe?
Kind regards,
Hi again,
I just realized that you posted a sample earlier in this thread and so I took a look at it. Judging by the sample, I'm guessing that your concern is when the text seems to jump when you make the form smaller.
If that's the case, then the jump seems a lot more pronounced in the UltraLabel than in the UltraTextEditor - at least on my system. But I was able to completley eliminate it by doing two things:
First, turn off WordWrap on the UltraLabel. Wrapping when you are using TextTrimming doesn't really make sense in this case, anyway.
Second, switch to GDI text rendering (instead of GDI Plus). You can do this for all of the Infragistics controls in your application by setting a static property:
Infragistics.Win.DrawUtility.UseGDIPlusTextRendering = false;
I added this line in the form's constructor right before the InitializeComponent call.
Hi,
There's nothing we can do about how the DotNet framework draws the text, nor is there any way we can determine the offset. So the only way to "solve" this would be to set up the application in such a way that things are consistent.
But... what exactly is the problem you are trying to solve here? Why is the offset a problem? Is it inconsistency across controls? Is it inconsistency within a single control? You're not changing the TextTrimming dynamically are run-time, are you?
Can you provide some screen shots or some more detailed description of exactly why the offset is a problem? If so, then perhaps we can come up with a solution that works for your application.
For UltraTextEditor this is a solution.
But it does not work for