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
4160
How to set the order of contained controls
posted

Hello

Suppose that by code one creates instances of collapsed ExpandableGroupBoxes -making each one to dock on the top -and sets as parent container an UltraPanel. This creates the effect that the instances tiles at the top of the ultrapanel. How can I set that every time a new instances is created, that it places itself on the bottom of the set? That is, at the moment every new instances if placing itself as the topmost control of the set.

Thanks a lot.

 

Parents
No Data
Reply
  • 44743
    Verified Answer
    posted

    As this is the normal Windows Forms docking behavior, this is not specific to the UltraPanel and can work with any Control docked within any parent. Docked controls are arranged in reverse order that they exist in the Controls collection (their z-order). So after adding the Control to the parent collection, call BringToFront() on that child Control. That will put it at index 0 of the Controls collection and it will therefore be the last control to get positioned, which means it will be placed at the bottom of the top docked Controls.

Children
No Data