Label Padding

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
 
F

Family Tree Mike

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.
 
P

pregis

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.
 
D

David Stubbs

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
 

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