By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,474 Members | 966 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,474 IT Pros & Developers. It's quick & easy.

Center a Label in a form/panel

P: n/a
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.

Jun 25 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a

"theinvisibleGhost" <th***************@yahoo.comwrote in message
news:11**********************@k79g2000hse.googlegr oups.com...
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
Jun 25 '07 #2

P: n/a
On Jun 25, 12:00 pm, "Mantorok" <n...@none.comwrote:
"theinvisibleGhost" <theinvisibleGh...@yahoo.comwrote in message

news:11**********************@k79g2000hse.googlegr oups.com...
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
Ah that's got it, I had the autosize turned to on.
Cheers =)

Jun 25 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.