XP SP2 Shifts Labels!

G

Guest

I've written a very simple VB.NET app with a form that has a Label and a
TextBox to the right of the Label. The Label has textalign=MiddleRight.

When I run the app on XP SP1, the Label's text butts up to the TextBox.
When I run it on XP SP2, the rightmost letter (approx.) of the Label's text
runs behind the TextBox.

Both boxes are running .NET framework 1.0 with no service pack. Although, I
tried .NET framework service packs 1, 2, and 3 on XP SP2 in an attempt to
remedy the problem and none worked.

Has anybody seen this problem? Any idea how to make the alignment the same
on XP SP1 and XP SP2?

Thanks for any help!
 
G

Guest

Has anybody seen this problem? Any idea how to make the alignment the same
on XP SP1 and XP SP2?

Have you tried enabling/disabling ClearType on both systems. IIRC, XP SP2
changes the default setting so that ClearType (or possibly Standard
smoothing) is enabled by default. Either one could potentially adjust the
font rendering just enough to prevent the label fitting properly any more if
it's a close thing.

The way to fix it would be to resize and reposition the label dynamically
using Graphics.MeasureString (or similar), or for a slightly more hacky (but
easier) solution leave enough room between the label and textbox that the
difference isn't obvious.

AndyC
 
G

Guest

Andy,

Thanks very much for your help. The ClearType setting is the cause of the
shifting labels. If I address this by means other than repositioning the
design-time location of the labels, I will post the code here.

Thanks again,
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top