During FlowLayoutPanel scrolling, background distorts + flickers

Viewed 9553

I have a windows form application that has a background. Within it, I have a flowlayoutpanel with a transparent background. When I scroll, the following happens:

enter image description here

I also see some flickering. I've tried all the doublebuffered business, and it doesn't work.

Any suggestions?

6 Answers

try this using Extended Window Styles

 class MyFlowLayoutPanel : FlowLayoutPanel
{
    protected override CreateParams CreateParams
    {
        get
        {
            var cp = base.CreateParams;
            cp.ExStyle |=0x2000000 | 0x02000000;
            return cp;
        }
    }
    public MyFlowLayoutPanel()
    {
        this.DoubleBuffered = true;
    }
    protected override void OnScroll(ScrollEventArgs se)
    {
        this.Invalidate();
        base.OnScroll(se);
    }
}
Related