Panel.Dock Fill ignoring other Panel.Dock setting

后端 未结 10 1083
我寻月下人不归
我寻月下人不归 2020-12-04 06:02

If you create a panel on a form and set it to Dock=Top and drop another panel and set its Dock=Fill, it may fill the entire form, ignoring the first panel. Changing the tab

10条回答
  •  渐次进展
    2020-12-04 06:25

    I know this is an old post but I discovered something useful. To adjust sibling control order programatically for dynamically created control(s), you can do something like:

    parentForm.Controls.SetChildIndex (myPanel, 0) 
    

    In my case, I did this to move a Dock/Fill panel to be the first control in my form so that it would not overlap with another docked control set to Dock/Top (a menu strip).

提交回复
热议问题