label right alignment bug - LabelRightAlignBug.zip [0/1]

  • Thread starter Thread starter Randy Danielson
  • Start date Start date
R

Randy Danielson

Hello,

I put several labels on a form, set all their left positions in the same
spot, set textalignment to middleright, and set their text values ending
with a :

I noticed that the colons did not line up on the right and found that
the number of characters in the text property of the label is the
determining factor.

I have attached a sample.


Thanks
Randy
 
* Randy Danielson said:
I have attached a sample.

I am not able to see an attachment. Maybe you forgot to add it, or it
has been removed by the news server.

Instead of posting the attachment to the group, consider uploading it
somewhere and post the URL to the file instead.

I didn't see your sample, but I assume that it has something to do with
GDI+'s bad rendering of text or/and in combination with your graphics
hardware.
 
I put several labels on a form, set all their left positions in the same
spot, set textalignment to middleright, and set their text values ending
with a :

I wasn't able to see the attachment either, but did you set the width
of the labels to the same value, too? And did you turn off Autosize?
 
Christoph Nahr said:
I wasn't able to see the attachment either, but did you set the width
of the labels to the same value, too? And did you turn off Autosize?

ACutally this is trivial to reproduce so I don't think the attachment is necessary. Just create a new windows application project, then add a label. Set it to no autosize, right {middle|top|bottom}. Copy and paste, then make sure the left postion is exactly the same (everything else the same bar the top position). Now change the text (using the : at the end helps to see it). They don;t align. If you change the font, it gets better or worse, same with the point size. Seems like a bug in the way it calculates the start point when drawing it.

HOwever, I did wonder myself if I was misundersntading the purpose of right align in lables. But I can't think of another interpretation off-hand.

Jim
 
Back
Top