Label Padding

  • Thread starter Thread starter pregis
  • Start date Start date
P

pregis

Hello,

I have a label with a Fixed Single border around it... I am looking to
increase the padding between the left and right sides of the border at run
time. I can't seem to get it... any help you could offer would be much
appreciated.

Patrick
 
pregis said:
Hello,

I have a label with a Fixed Single border around it... I am looking to
increase the padding between the left and right sides of the border at run
time. I can't seem to get it... any help you could offer would be much
appreciated.

Patrick

Change autosize property to false, set the size to something bigger than
current, and set the textalign property to MiddleCenter.

To get the size of the lable correct if its contents varies, you may
need to work with Graphics.MeasureString.
 
That did it... thank you!

Family Tree Mike said:
Change autosize property to false, set the size to something bigger than
current, and set the textalign property to MiddleCenter.

To get the size of the lable correct if its contents varies, you may
need to work with Graphics.MeasureString.
 
While fooling around with Label trying to get rid of the mysterious left (and probably all around) non-Padding padding, I shifted the Label.FlatStyle property from Standard to System.

I was thrilled to find that the text was painted flush left, as desired.

I'm using VB 2010 Express.

Hope this helps!

David Stubbs
Usability Architects, Inc.
Portland OR, US
 
Back
Top