i need to add vscroll control to a form in VB.net and i need to use it to scroll the form where i need to add more controls in the form where the size of form not able me to add them ?
and i need to know how to make the scrolling to show more controls in the form ?
thank you in advance
"Vscroll" is not the name of a control, but I assume it's an abbreviation for vertical scrollbar.
In that case, you can simply add a
VScrollBar
control to your form. You'll find it in the Toolbox under the "All Windows Forms" category. Unfortunately, you'll have to wire it up yourself. By default, the control won't do anything exciting.HScroll
andVScroll
are also properties of any control that derives fromScrollableControl
, such as a form and all panel controls. By setting one or both of these properties to "True", you can cause a horizontal or vertical scroll bar to appear, no additional control required.But before you embark too far down this road, I should caution you against reinventing the wheel. Controls that derive from
ScrollableControl
also have anAutoScroll
property that will cause scrollbars to appear automatically when the content they contain does not fit in the viewable area of the control. Simply set this property to "True", and let the magic happen. It maintains the visibility of the scrollbars automatically, eliminating the need to use a separate control or set theHScroll
orVScroll
properties.If I were you, I would add either a
TableLayoutPanel
or aFlowLayoutPanel
control to my form, and then place all of the other controls I wanted to add inside of the panel. Then, I would just turn on theAutoScroll
property and let the control maintain everything automatically.I think you want the form's AutoScroll property.