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
765
Not Docking To The Right Place
posted

I have 3 horizontal panels (top is docked to top, middle is fill, and bottom is docked bottom) and then a bunch of things docked but unpinned on the right.  When I go to dock one of these items on the right, it puts it below the top docked item so it takes up the bottom 2/3rds of the space.  I would like it to take up the whole right area space.  Any idea why its docking below the item docked to the top?

Parents
No Data
Reply
  • 44743
    posted

    This is really an issue of the order in which the controls were added to the Form and is actually unrelated to the UltraDockManager:

    Add a Button to a blank Form and set its Dock property to Right. Then add a second Button to the Form and set its dock property to Top. The Button on the right will occupy the entire height of the Form.

    Now delete both Buttons from the last example and add two new Buttons to the Form but dock them in opposite orders: set the Dock property of the first Button to Top and the second Button to Right.  Now the Button on the top occupies the entire width of the Form.

    The docking infrastructure in Windows Forms will allow the first controls added to the take precedence when occupying space based on their Dock properties. The UltraDockManager is just utilizing this docking infrastructure by settings the Dock properties of the docking areas which host the docked controls.

    It sounds like at some point the order in which you docked the Controls has caused the layout to not the be way you want it to be. If you setup your docking panes in the Forms designer, I would recommend you open the Form in design mode. Then pin all the unpinned panes on the right. Drag those panes and re-dock them on the right so they occupy the entire height of the Form. Then unpin them again. This will set a new order of the Controls and the next time they are pinned, that order will be reused and the panes will occupy the entire height again. However, if you setup your panes with code, just make sure the panes on the right are the first panes which are docked.

Children
No Data