我有以下问题:我在表单中放置了一个拆分器控件(不是拆分容器)并添加了 2 个面板。分离器工作正常,但是当我移动分离器时,它开始闪烁 - 面板没有。
我使用拆分容器得到了相同的结果。
我试过了,但没有任何效果
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
this.DoubleBuffered = true;
...
class XSplitter : Splitter
{
public XSplitter() : base()
{
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
this.DoubleBuffered = true;
}
}
class XPanel : Panel
{
public XPanel() : base()
{
this.SetStyle(ControlStyles.UserPaint, true);
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
this.SetStyle(ControlStyles.DoubleBuffer, true);
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
this.DoubleBuffered = true;
}
}
我使用 Windows 8.1 和 VS 2010
谢谢帮助!