简体   繁体   中英

C# winform panel not showing scrollbar

I've already seen similar questions but still could not get it to work

I have the following controls on my Form (refer image):

A: a groupbox
B: another groupbox
C: a panel which contains A and B

Height of the panel is adjusted on window resize. I have tried using Autoscroll = true on the panel but the scrollbars won't show.

The groupbox A is anchored to Top Left and has dock Top . The groupbox B is anchored to Top Left but has dock Fill`.

Any idea why the scrollbar isn't showing ?? Also, What dock property should I give to new controls ( groupbox, maybe ), if I plan on adding more of them. I would want to show them one below the other.

在此处输入图片说明

Make your GroupBoxes To dock Top both. and turn autoscroll on true for your panel. That way they will stack on each other expanding themselfs down and ignoring the panel height. Also set a minheight and minwidth for both so if the panel gets to small it will start so overflow and show the scrollbars.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM