Windows form Label Control Autosize and wrap text vertically

The other day I was trying to get a label control to autosize vertically and struggled to do it… but there is a simple trick…

Set the maximum width.

If you say “AutoSize=true” but set no MaximumSize.Width property it will just disappear off the right hand side of you form.

Set the MaximumSize.Width and the control autosizes correctly and wraps the text in the label control.

Cheers

 

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.