How to add a Vscroll control to form in Visualbasic.net?

Do I need to add a vscroll control to a form in VB.net and I need to use it to scroll the form, where do I need to add more controls to the form, where the size of the form does not allow me to add them?

and I need to know how to make the scroll show more controls on the form?

early

0
source share
2 answers

I think you need the AutoScroll property form .

+4
source

"Vscroll" is not a control name, but I assume it is an abbreviation for vertical scrollbar .

In this case, you can simply add VScrollBar control to your form. You will find it in the toolbar under "All Windows". Unfortunately, you will have to connect it yourself. By default, the control will not do anything interesting.

HScroll and VScroll are also properties of any control derived from ScrollableControl , such as a form and all panel controls. By setting one or both of these properties to True, you can call up the horizontal or vertical scroll bar without requiring additional control.

But before you start too far along this road, I must warn you about reinventing the wheel. Controls derived from ScrollableControl also have an AutoScroll property, which will cause scrollbars to appear automatically when the content they contain does not match the visible control area. Just set this property to True and let the magic happen. It automatically maintains the visibility of scroll bars, eliminating the need for a separate control or HScroll or VScroll .

If I were you, I would add either a TableLayoutPanel or FlowLayoutPanel to my form, and then put all the other controls that I would like to add inside the panel. Then I just turned on the AutoScroll property and let the control support everything automatically.

+3
source

Source: https://habr.com/ru/post/912470/


All Articles