简体   繁体   English

流布局面板放大时放大流布局面板中的控件

[英]Enlarge controls in flow layout panel when flow layout panel enlarge

I have a question about my c# winform.我对我的 c# winform 有疑问。 When I enlarge my flow layout panel, I want my controls in it enlarge depends on my size of the flow layout panel.当我放大流布局面板时,我希望其中的控件放大取决于流布局面板的大小。 How can I do that?我怎样才能做到这一点?

For DataGridView changes with the size of the form,you could use control Control.Anchor Property .对于 DataGridView 随窗体大小的变化,您可以使用控件Control.Anchor 属性

Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent.获取或设置控件绑定到的容器的边缘,并确定控件如何与其父级一起调整大小。

Set the property Anchor of the DataGridView to Top, Left, Right, and it will resize with the container.将 DataGridView 的属性 Anchor 设置为 Top、Left、Right,它将随容器调整大小。 If your DataGridView is placed in a container (panel), then the panel should also be anchored.如果您的 DataGridView 被放置在一个容器(面板)中,那么该面板也应该被锚定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM