MS .Net C# winform UI related tips:Increasing the width of label according to text width (winform Label wordwrap)

If you want Label to grow as its text grows:

Label.AutoSize=true;

(this will make your label to grow in width)
if you want text to get wrapped and your label to become, multiline automatically:

Label.MaximumSize = new Size(max_width_of_label, 0);
Label.AutoSize=true;

(in above label will grow but will not take care of other control, i mean it will not care about them, just try your self and see what happens)

You may also like to see:

Advertisements
Published in: on July 23, 2010 at 4:05 pm  Leave a Comment  
Tags: ,

The URI to TrackBack this entry is: https://indiandeve.wordpress.com/2010/07/23/ms-net-c-winform-ui-related-tipsincreasing-the-width-of-label-according-to-text-width-winform-label-wordwrap/trackback/

RSS feed for comments on this post.

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: