2011年7月4日

[筆記]How to prevent C# controls flickering when resizing

Just add this below your Form constructor :

protected override CreateParams CreateParams
{
    get
    {
        CreateParams cp = base.CreateParams;
        cp.ExStyle |= 0x02000000;   // WS_EX_COMPOSITED. Prevents flickering.
        //cp.ExStyle |= 0x00080000; // WS_EX_LAYERED. Transparency key.
        return cp;
    }
}

wish this would help you :)

沒有留言: