In WinForms I am using a Label to display different messages like success, failure, etc.
I\'d like to center that label in the center form.
The accepted answer didn't work for me for two reasons:
BackColor set so setting AutoSize = false and Dock = Fill causes the background color to fill the whole formAutoSize set to false anyway because my label text was dynamicInstead, I simply used the form's width and the width of the label to calculate the left offset:
MyLabel.Left = (this.Width - MyLabel.Width) / 2;