Panel doesn't show scroll bars

  • Thread starter Thread starter spikedpunchvictim
  • Start date Start date
S

spikedpunchvictim

Perhaps one of you geniouses can help. I have a panel whose AutoSize =
true. This Panel is originally empty when the program starts, and it
is programtically populated with my own User Control. The User Control
is inherited from a Panel itself. I programatically add each of these
User Cotnrols to the form. If the Controls go outside of visibility,
I'm expecting vertical scrollbars to show up so the user can scroll
down further to see all of the Controls. But the vertical scrollbars
don't appear. I have tried everything to get them to come up. But I'm
sure I'm missing something simple. I'm also calling "Invalidate()" and
"PerformLayout()" after adding each control. No luck.

What am I missing?

Thanks in advance,
~William
 
Perhaps one of you geniouses can help. I have a panel whose AutoSize =
true. This Panel is originally empty when the program starts, and it
is programtically populated with my own User Control. The User Control
is inherited from a Panel itself. I programatically add each of these
User Cotnrols to the form. If the Controls go outside of visibility,
I'm expecting vertical scrollbars to show up so the user can scroll
down further to see all of the Controls. But the vertical scrollbars
don't appear. I have tried everything to get them to come up. But I'm
sure I'm missing something simple. I'm also calling "Invalidate()" and
"PerformLayout()" after adding each control. No luck.

What am I missing?

Have you tried setting AutoScroll property? It is false by default.
 
Yes. I mistakelnly put AutoSize = True in the above post, but I meant
AutoScroll = True.
 
hey man!!
as you are adding panel with in a panel . make sure that u set
AutoScroll property of all the panels in the hierarchy. Make sure that
the child controls with in the panel has "AutoSize" property set to
false.

If for god sakez this doesn't work, try some manual labour work. By
Capturing the "Resize" event of the panel, explicitly handle the sizes
of all the contained controls.
 
Back
Top