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