gpt4 book ai didi

c# - FlowLayoutPanel AutoSize 仅在垂直方向?

转载 作者:太空狗 更新时间:2023-10-29 20:01:27 25 4
gpt4 key购买 nike

我正在 FlowLayoutPanel 中动态加载图像。我需要此面板自动调整大小,但只能垂直调整。

这是否可能?如果可能,我该如何实现?

最佳答案

简单,添加一个类型控件的事件已添加:

private void flowLayoutPanel1_ControlAdded(object sender, ControlEventArgs e)
{
if (flowLayoutPanel1.Controls.Count % 10 == 0)
flowLayoutPanel1.SetFlowBreak(e.Control as Control, true);
}

设置 AutoSize = true

设置 flowdirection = LeftToRight

关于c# - FlowLayoutPanel AutoSize 仅在垂直方向?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15880458/

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