VB.Net - How to Scroll GroupBox

Sorry I'm not familiar with vb.net. It was simply thrown into the project without experience with vb.net.

I need to add some things to an application written by someone who is no longer in the picture. I have to add more text fields to the group box, and when I do this, it exceeds the size of the form. How can I do this to scroll through a group box?

+4
source share
4 answers

GroupBox, since it is not the result of a ScrollableControl, therefore, cannot itself have a scroll.

So...

Place the GroupBox inside the panel and set the AutoScroll panel to true .

Guides:

Adding a control panel

Setting properties (total)

Moving content is just a selection of all the elements you want to move, and click and drag them to a new location.

+5
source

You can set the AutoSize property of the group box to true , and then set the AutoScroll form to true . This should resize the group box so that everything in it is visible, and then the scroll bar will be in the form. If you do not want your form to have a scroll bar for any reason, you can use the panel and set its AutoScroll to True so that only the panel has a scroll bar.

+3
source

Add a Panel with no border inside the GroupBox to group the controls (place the controls inside). Then:

 Panel1.ScrollBars = ScrollBars.Vertical 

Or even ScrollBars.Auto .

+1
source

GroupBox does not have the scroll itself. Most likely, the simplest solution here is to simply place the panel inside the group box and instead add text fields to the panel.

+1
source

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


All Articles