Fix only the width of the Label and use a scrollbar for height in WinForm

Here, I am going to demonstrate quick fix of these two problems.

Fixed Width:

Keep AutoSize  property of the Label to true.
Set the MaximumSize property to, say, (100,0). So that its horizontal growth has been capped to 100 but there will be no restriction on the vertical growth.

Add Scrollbar to Windows Label:

Place the Label inside a Panel and set its AutoScroll property to true.
you can also use a read-only, multi-line textbox to accomplish the same task.

Leave a Reply

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

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

Google photo

You are commenting using your Google 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 )

Connecting to %s

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