gpt4 book ai didi

c# - 带有 AutoSize 的面板内的 FlowLayoutPanel 问题

转载 作者:太空宇宙 更新时间:2023-11-03 14:30:56 26 4
gpt4 key购买 nike

我有以下控件层次结构:

Form
Panel (AutoSize = true, AutoSizeMode = GrowAndShrink, Dock = Top)
FlowLayoutPanel (AutoSize = true, AutoSizeMode = GrowAndShrink, Dock = Top)
Control1, Control2, Control3, Control4, ...
FlowLayoutPanel (AutoSize = true, AutoSizeMode = GrowAndShrink, Dock = Top)
Control1, Control2, Control3, Control4, ...

以下是它在各种尺寸下的布局方式:

8个按钮全部可见,但Panel忘了缩小

Fully visible all 8 buttons, but the Panel forgot to shrink http://img534.imageshack.us/img534/3575/panels1.png

第一个 FlowLayoutPanel 是完全可见的,但第二个只有一半可见,缺少 button8

The first FlowLayoutPanel are fully visible, but the second is only half visible, button8 is missing http://img301.imageshack.us/img301/5296/panels2.png

第一个 FlowLayoutPanel 是完全可见的,但第二个只有一半可见,缺少 button7 和 button8

The first FlowLayoutPanel are fully visible, but the second is only half visible, button7 and button8 are missing http://img697.imageshack.us/img697/4644/panels3.png

第一个 FlowLayoutPanel 完全可见,但第二个只有四分之一可见,按钮 6、按钮 7 和按钮 8 不见了

The first FlowLayoutPanel are fully visible, but the second is only quarter visible, button 6, button7 and button8 are missing http://img168.imageshack.us/img168/6428/panels4.png

如您所见,我对这种行为并不满意。我可以做些什么来完成所有这些工作吗?

最佳答案

在我看来这像是一个错误...您可以向 Microsoft 报告它。

一种可能的解决方法:尝试使用 tableLayoutPanel 而不是外部面板。像这样:

Form
TableLayoutPanel (1 column, 2 rows with 50% size type)
FlowLayoutPanel1 (AutoSize = true, in first row of the TableLayoutPanel, Dock = Fill)
Button1, Button2, Button3, Button4, ...
FlowLayoutPanel2 (SutoSize = true, in second row of the TableLayoutPanel, Dock = Fill)
Button1, Button2, Button3, Button4, ...

关于c# - 带有 AutoSize 的面板内的 FlowLayoutPanel 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2611313/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com