屏幕最小化时,Flowlayout面板无法调整大小 [英] Flowlayout panel not resizing when screen is minimised

查看:139
本文介绍了屏幕最小化时,Flowlayout面板无法调整大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

伙计们,有一个小问题,我目前正在做一个带有许多控件的Windows窗体,我有一个带有几个标签,过滤器和按钮的FlowLayoutPanel.当屏幕最大化时,一切都很好,就在我最小化FlowLayoutPanel中的控件的屏幕时.任何帮助都非常感谢.
谢谢大家

Hey guys, have a small issue, I am currently doing a windows form with loads of controls, I have a FlowLayoutPanel with a few lables, filters and buttons. When the screen is maximised everything is fine its just when I minimise the screen that the controls in the FlowLayoutPanel get messed up. Any help is very much apreciated.
Thanks guys

推荐答案

我无法复制您描述的行为.

这就是我所做的.

1.在"WinForm"上放置面板":将其"AutoSize"设置为"false",将"Dock"设置为"None". 请参阅下面的注释#1

2.在面板"中放置"FlowLayoutPanel":将其"Dock"属性设置为"Fill",将"AutoSize"设置为"true",将AutoSizeMode设置为"GrowAndShrink".

3.在三行上放置一堆控件:在"FlowLayoutPanel:行#1上的五个​​"按钮,行#2上的两个多行文本框",行#3上的两个"DataGridViews"中. >
4.遍历"FlowLayoutPanel"中的每个控件:将每个"AutoSize属性"设置为"true",将每个"AutoSizeMode"设置为"GrowAndShrink". 请参阅下面的注释2:

5.运行项目,在最小化和最大化之间切换可见的"WinForm,并任意调整窗口大小:观察到FlowLayOutPanel内部控件的视觉外观和关系没有变化.

注释#1:在表单"中将面板"停靠栏设置为填充",并且当您调整表单"的大小或在"最大化和最小化:FlowLayoutPanel控件内容将被加扰".

注释#2:上面的步骤#4可能只是不必要的伏都教徒?

最后,我承认对使用``FlowLayoutPanel及其邪恶的孪生对象" TableLayoutPanel存有偏见:它们对我来说还没有用....

最好,比尔
I am unable to duplicate the behavior you describe.

Here''s what I did.

1. put a ''Panel on a ''WinForm: set its ''AutoSize to ''false, ''Dock to ''None. see note #1 below

2. put a ''FlowLayoutPanel inside the ''Panel: set its ''Dock property to ''Fill, ''AutoSize to ''true, AutoSizeMode to ''GrowAndShrink.

3. put a bunch of controls on three rows: in the ''FlowLayoutPanel : five ''Buttons on row#1, two multi-line ''TextBoxes on row#2, two ''DataGridViews on row#3.

4. went through every control within the ''FlowLayoutPanel: set every ''AutoSize property to ''true, and every ''AutoSizeMode to ''GrowAndShrink. see note #2 below:

5. ran the project, toggled the visible ''WinForm between minimzed and maximized, and resized the Window arbitrarily: observed no change in the visual appearance and relationships of the controls inside the FlowLayOutPanel.

note #1: set the ''Panel ''Dock to ''Fill in the ''Form, and "all hell" will break loose when you resize the ''Form, or toggle it between ''Maximized and ''Minimized: FlowLayoutPanel control contents will be "scrambled."

note #2: step number #4 above may have been just unnecessary voodoo ?

Finally, I admit to a bias against use of ''FlowLayoutPanel, and its evil twin, ''TableLayoutPanel: they just have not been useful to me ... yet.

best, Bill


这篇关于屏幕最小化时,Flowlayout面板无法调整大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆