How do you add a scrollbar to a Panel control with many controls in windows form application?
Asked
Active
Viewed 9.2k times
1 Answers
131
Just set the AutoScroll
property of your Panel
to true and it will handle adding the scrollbars for you.
this.panel1.AutoScroll = true;

Samuel
- 37,778
- 11
- 85
- 87
-
51Bear in mind that your controls will need to be anchored to the Top of the Panel to cause Vertical scroll bars automatically, and the Left of the Panel to cause Horizontal scroll bars automatically. If Anchor is set to None that control will be ignored by AutoScroll. I tried to add this to the answer but it was rejected. – Jason S Nov 17 '11 at 21:04
-
14In addition, your controls shouldn't be docked in the panel or the scrollbar won't appear either. – namey Oct 16 '16 at 20:48