FlowLayoutPanel行高问题

问题描述

我想在FlowLayoutPanel中添加动态按钮。 大纲是:

      {
        flowLayoutPanel1.Controls.Clear();
        flowLayoutPanel1.FlowDirection = FlowDirection.LeftToRight;
        flowLayoutPanel1.AutoScroll = true;
        flowLayoutPanel1.SuspendLayout();
        for (int i = 0; i < 15; i++)
        {
            Button btn = new Button();
            btn.Text = string.Format("button_{0}",i);
            btn.Width = 160;
            btn.Height = 50;
            if ((i) == 4)
            {
                btn.Height = 90;
                btn.Width = 326;
            }
            flowLayoutPanel1.Controls.Add(btn);
            if ((i) == 3)
            {
                flowLayoutPanel1.SetFlowBreak(btn,true);
            }
        }
        flowLayoutPanel1.ResumeLayout(true);
    }

问题是第二行过高。 enter image description here

主窗口很大。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...