Center a Label in a form/panel

T

theinvisibleGhost

Is there any easy way of centering a label in a form or panel?
I can dock, and anchor but not get my label to stay centered,
short of resorting to playing with the top and left properties of
the label each time the form is resized or the label changed.

Cheers
Chris.
 
M

Mantorok

theinvisibleGhost said:
Is there any easy way of centering a label in a form or panel?
I can dock, and anchor but not get my label to stay centered,
short of resorting to playing with the top and left properties of
the label each time the form is resized or the label changed.

I assume you Dock.Fill and turn AutoSize off in your label, and then set
your text alignment to be Middle.

Haven't tried it myself though.

Kev
 
T

theinvisibleGhost

I assume you Dock.Fill and turn AutoSize off in your label, and then set
your text alignment to be Middle.

Haven't tried it myself though.

Kev

Ah that's got it, I had the autosize turned to on.
Cheers =)
 

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