简体   繁体   中英

How do I make a top-docked control appear *under* the existing top-docked controls?

I am dynamically adding controls to my form with Dock = DockStyle.Top . I want subsequent controls to appear below the existing ones. By default, each new control added goes to the top. Is there an easy way to do this?

Edit: I am adding these controls at run time, not design.

It never fails. I just discovered an answer myself, but for anyone else who finds this question later, the answer was to call .SetChildIndex(ctrl, 0) on the container.

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