问题描述
我想在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 (将#修改为@)