Winforms: What Determines if Docking Moves Other Controls

|▌冷眼眸甩不掉的悲伤 提交于 2021-02-11 17:57:20

问题


For example, within a TabPage, I have a DataGridView that is docked "Fill". If I set the dock property of a UserControl to the the "Right" position, the DataGridView moves to the left as expected. If I replace the UserControl with a Panel or Label (also docked to the "Right" within the TabPage) the DataGridView does not make room. The Panel or Label just overlay the DataGridView. I tried stackoverflow and did some reading but did not see any rules (yet). Thanks.


回答1:


Their Z-order. You can manipulate it with the Bring to Front and Move to Back context menu items, right-click a control to see the menu.

It is much clearer when you use the View + (Other Windows) + Document Outline window, it lists them in Z-order underneath their container. And allows you to drag+drop the controls to change their order, you see the effect in the designer immediately.



来源:https://stackoverflow.com/questions/21858290/winforms-what-determines-if-docking-moves-other-controls

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!