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

 

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: