TableLayoutPanel容器中控件过多时显示出现闪烁的解决方案

通过反射技术,我们可以给某对象的私有属性赋值,解决TableLayoutPanel容器中控件过多时显示出现闪烁的问题,需要设置容器的双缓冲属性。在窗体加载事件中添加以下代码: 

this.tableLayoutPanel1.GetType()
    .GetProperty("DoubleBuffered", BindingFlags.Instance | BindingFlags.NonPublic)
    .SetValue(this.tableLayoutPanel1, true, null);

 

你可能感兴趣的:(tablelayout)