Home > Windows Forms > Windows form Label Control Autosize and wrap text vertically

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

 

VN:F [1.9.22_1171]
Rating: 10.0/10 (2 votes cast)
Windows form Label Control Autosize and wrap text vertically, 10.0 out of 10 based on 2 ratings

Categories: Windows Forms Tags:
  1. No comments yet.
  1. No trackbacks yet.