Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
926
Scrollbar
posted

Hello,

I have a usercontrol. In this usercontrol i have one main sustem.windows.forms.panel and to that i have 5 groupboxes. I have set dock property of 4 groupboxes to top and the last group box to dock to fill.when I set the Autoscroll to "true" for the panel, I can see only vertical scrollbar with 4 groupboxes which are docked to Top.The groupbox which is docked to fill is not shown at all. Why is this so ?

If I set the dock to none for the last groupbox, both the scrollbars (vertical and horizontal) are visible with the last groupbox too.

Any ides as to hwy is this happening ?Or I am missing anything.

Thanks

  • 37774
    posted

     I don't think this is specific to the GroupBoxes, but rather any control when using Docking.  I don't think that you're going to get consistent behavior when combining Fill docking with AutoScroll; the AutoScroll is meant to show scrollbars when a control extends beyond the range of its parent, but when you specify Fill, that is telling the control that it should size itself to take up the remaining space (in other words, *not* extend beyond the range of its parent).  Chances are that since there is not enough space for the Fill GroupBox, the panel is sizing it to be hidden.  You might be able to work around this with a MinimumSize, but I'm not sure.

    -Matt