为“面板中的控件”设置锚点在“flowlayoutpanel”内
在我的Windows应用程序中,
我在flowlayoutpanel中有一个普通面板在
这个普通面板中,我有一些输入控件(例如标签,文本框...)
我已经设置了锚点属性,认为当我调整窗口大小时它会自动调整大小。
但是当我测试它时,只有 flowlayoutpanel 自动调整大小,因为我可以看到滚动条已进一步向右移动......普通面板中的控件根本没有移动。
有人知道这里出了什么问题吗?
谢谢你!
In my windows application
I have a normal panel inside a flowlayoutpanel
In this normal panel, i have some input controls(e.g. labels, textbox...)
I have set the anchor properties thinking that it will auto-resize when I resize the window.
But when i tested it, only the flowlayoutpanel auto-resize itself, as i can see that the sroll bar has moved further toward the right... the contorls in the normal panel didnt move at all.
anyone know what is wrong here?
Thank You!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我也遇到过同样的问题。显然,FlowLayoutPanel 中的控件的大小是根据该面板中最宽的控件来调整的。我通过覆盖 FlowLayoutPanel 上的“Resize”事件并更改相对于 FlowLayoutPanel 大小的控件之一来解决此问题:
设置一个控件后,其他控件的大小就会正确调整。对于那些指定了锚点的情况也是如此。
I have encountered the same problem. Apparently, the controls in the FlowLayoutPanel are sized according to the widest control in this panel. I've solved this by overriding the 'Resize' event on the FlowLayoutPanel and change one of the controls relative to the size of the FlowLayoutPanel:
Once one is set, the others are resized properly. This is also true for those that have Anchors specified.
在下面的帖子中,莱尼已经回答了这个问题
cannnot-resize-child-controls -in-a-flowlayoutpanel-control
或这个:
flowlayoutpanel-issues
所以我认为没有办法。
您究竟为何需要这种控制?
In the following post Lenny answered the question already
cannnot-resize-child-controls-in-a-flowlayoutpanel-control
or this:
flowlayoutpanel-issues
So i think theres no way.
For what exactley you need that control?