【发布时间】:2017-02-18 06:00:39
【问题描述】:
在运行时,我将控件添加到从 TableLayoutPanel 继承的控件中。根据用户交互,一次添加一个控件,而不是循环添加。
这是我从 TLP 继承的控件的设置:
this.RowCount = 0;
this.RowStyles.Clear();
this.Dock = DockStyle.Fill;
this.VerticalScroll.Enabled = true;
this.HorizontalScroll.Enabled = false;
this.AutoScroll = true
我正在将用户控件添加到面板底部,如下所示:
var uc = new FooControl();
this.Controls.Add(uc);
this.SetRow(uc, this.Controls.Count - 1);
this.SetColumn(uc, 0);
我想将该行/控件滚动到视图中。
这是怎么做到的?
【问题讨论】:
标签: c# .net winforms tablelayoutpanel