c# - 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);
}
问题是第二行太高了。 在此处输入图像描述
主窗口相当大。</p>
解决方案
推荐阅读
- python - 在数据框列上使用 map() 时出现 InvalidIndexError
- terraform - 为列表传递多个值
- nestjs - NestJS 将实体数组转换为 dto
- python - 使用下拉菜单、Django DetailView 和 get_context_data() 显示模型的对象
- typescript - 如何使用 Typescript 创建常量数组的联合类型索引?
- python - 熊猫左合并将数据保留在重复列的右数据框中
- python - OCO SELL MAX Python Binance
- excel - Excel / Powershell - 从特定行开始的特定列中导出值
- mysql - phpMyAdmin 无需请求我的登录详细信息即可自动登录
- r - R 连接到 Kusto Azure,错误 readRDS