views:

1168

answers:

2

How do you add a scrollbar to a Panel control with many controls in windows form application?

A: 

First you'll have to set set the height & width of the Panel - something like this:

<asp:Panel style="height: 200px; width: 200px" ... >

then add the overflow style attribute to the panel and set it to "auto" - like this:

<asp:Panel style="height: 200px; width: 200px; overflow: auto;" ... >
Kirtan
This is assuming he is talking about ASP.NET and not WinForms/WPF.
Samuel
Unfortunately, the tags changed after the answer was posted.
Jeff Yates
+2  A: 

Just set the AutoScroll property of your Panel to true and it will handle adding the scrollbars for you.

this.panel1.AutoScroll = true;
Samuel