How to make user control scroll

  • Thread starter Thread starter moondaddy
  • Start date Start date
M

moondaddy

I have a form (vb.net 1.1) where I place various user controls in the body
section of the form at runtime. Often these controls will be larger than
the form (the form is resizable so I never know what the size is going to
be) and when it is, I need to have scrollbars available to the user. I
thought I could simply put a panel control in the body of the form
(dock=fill), then place the user controls in the panel (uc.parent =
me.pnlBody) (dock=fill), but that didn't work. I also set the panel's
AutoScroll property to true, but that didn't have any effect also.

Can anyone please advise on how to make scrollbars dynamically appear and
disappear as needed for the user controls?

Thanks.
 
moondaddy wrote:

the panel (uc.parent = me.pnlBody) (dock=fill), but that didn't work.
I also set the panel's AutoScroll property to true, but that didn't
have any effect also.
Thanks.

As well as the autoscroll property you need to set the AutoScrolMinSize
or the AutoScrollMargin properties...

Check out the helpfile at (watch for wrapping)
ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/cpref/html/frlrfsystemwin
dowsformsscrollablecontrolclassautoscrollmargintopic.htm

Regards Tim.
 
Back
Top