Search code examples
vb.netscrollbarmaxlength

ScrollBar Max Size VB.NET


How do you set the maximum range for the horizontal and vertical scrollbar in a panel in VB.NET 2008 ?


Solution

  • Set the AutoScroll property for the Panel to True. That ensures that the Panel automatically adjusts the scrollbars to keep all controls inside the panel viewable. You can override this behavior, in case you don't use controls or want a margin on the far end, by setting the AutoScrollMinSize property.