如何让子面板填充父面板中的剩余空间? [英] How does one make a child panel fill the remaining space in a parent panel?
本文介绍了如何让子面板填充父面板中的剩余空间?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在主面板中有两个面板(面板 1 和面板 2).Panel1 设置为 DockStyle.Top,panel2 设置为 DockStyle.Fill.我假设 panel2 会填充 panel1 之后剩下的剩余空间,但它只是填充整个主面板,panel1 位于 panel2 之上.
I've got two panels (panel1 and panel2) inside a main panel. Panel1 is set to DockStyle.Top and panel2 is set to DockStyle.Fill. I would assume that panel2 would fill the remaining space left after panel1 but instead it just fills the whole of the main panel and panel1 sits over panel2.
如何让 panel2 在 panel1 设置为 DockStyle.Top 后填充剩余空间而不重叠?
How do I get panel2 to just fill the remaining space after panel1 is set to DockStyle.Top without them overlapping?
推荐答案
对于 Panel2,请以各种方式使用锚点.
For the Panel2 use anchors in all ways.
这篇关于如何让子面板填充父面板中的剩余空间?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文