Panel doesn't show scroll bars

  • Thread starter spikedpunchvictim
  • 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
 
S

Sericinus hunter

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.
 
S

spikedpunch

Yes. I mistakelnly put AutoSize = True in the above post, but I meant
AutoScroll = True.
 
S

Serpent

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top