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.
OR,
you can also use a read-only, multi-line textbox to accomplish the same task.
Advertisements

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