I Can not get Labels to "Snap" to The Center of a cell in Tablelayoutpanel. I tried to Set The anchor to none in the Tablelayoutpanel.TextAlign to center & AutoSize to false in the Label before dragging it to the Tablelayoutpanel,no joy.The Label just stays at the top left?I want the Label to align with the TextBox I have in it.
Is their some kinda trick to this? or should i be using a other layout panel?
Set the Autosize property of your label to False, then either Dock the Label Top, Bottom or Fill, or drag it to the full width of the form and set Anchor to both Left and Right. Then set TextAlign to MiddleCenter.
Anchor the panel in the center of the form, set it to 1 row and 1 column, put your label in the cell and set the anchor on the label to None. With that done the label will "float" in the center of the panel.
Just replace Anchor property of the label from Top, Left to None. Set None
You should do the following:
AutoSize = false
.Worked for me..
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With