Word wrap for a label in Windows Forms

Nagu picture Nagu · Jul 30, 2009 · Viewed 173.4k times · Source

How can one get word wrap functionality for a Label for text which goes out of bounds?

Answer

John Gietzen picture John Gietzen · Sep 9, 2010

Actually, the accepted answer is unnecessarily complicated.

If you set the label to AutoSize, it will automatically grow with whatever text you put in it. (This includes vertical growth.)

If you want to make it word wrap at a particular width, you can set the MaximumSize property.

myLabel.MaximumSize = new Size(100, 0);
myLabel.AutoSize = true;

Tested and works.