在运行时,我将控件添加到从TableLayoutPanel继承的控件。基于用户交互,一次添加一个控件,而不是循环。如何将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);
我想将该行/控件滚动到视图中。
这是怎么做的?
'panel.VerticalScroll.Value = panel.VerticalScroll.Maximum'不实际工作。你可能想要测试一下。 – LarsTech