FlowLayoutPanel AutoSize仅在垂直方向? [英] FlowLayoutPanel AutoSize only in vertical?

查看:214
本文介绍了FlowLayoutPanel AutoSize仅在垂直方向?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I'm loading images dynamically inside a FlowLayoutPanel. I need for this panel to auto-size but only vertically.

这有可能吗?如果可以的话,我该如何实现呢?

Is this possible, and if so, how do I go about achieving it?

推荐答案

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

Simple, add a event of type control added:

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

这篇关于FlowLayoutPanel AutoSize仅在垂直方向?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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