111,103
社区成员




this.flowLayoutPanel1.VerticalScroll.Value = this.flowLayoutPanel1.VerticalScroll.Maximum;
this.flowLayoutPanel1.VerticalScroll.Value = this.flowLayoutPanel1.VerticalScroll.Maximum;
执行2遍,应该还是跟焦点问题有关 for (var i = 0; i < 100; i++)
{
Button bt = new Button();
bt.Text = i.ToString();
this.flowLayoutPanel1.Controls.Add(bt);
}
this.flowLayoutPanel1.VerticalScroll.Value = this.flowLayoutPanel1.VerticalScroll.Maximum;
注意尤其重要一点,flowLayoutPanel1的TableIndex设置一个较低的值,就是不要让焦点在这个pannel上,否则设置了无效,因为winform默认是显示在焦点上的