How to fix the flickering in User controls

后端 未结 12 1343
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-22 02:32

In my application i am constantly moving from one control to another. I have created no. of user controls, but during navigation my controls gets flicker. it takes 1 or 2 se

12条回答
  •  清酒与你
    2020-11-22 02:55

    I tried to add this as a comment but I don't have enough points. This is the only thing that's ever helped my flickering problems so many thanks to Hans for his post. For anyone that's using c++ builder like myself here's the translation

    Add the CreateParams declaration to your application's main form .h file e.g.

    class TYourMainFrom : public TForm
    {
    protected:
        virtual void __fastcall CreateParams(TCreateParams &Params);
    }
    

    and add this to your .cpp file

    void __fastcall TYourMainForm::CreateParams(TCreateParams &Params)
    {
        Params.ExStyle |= 0x02000000;  // Turn on WS_EX_COMPOSITED
        TForm::CreateParams(Params);
    }
    

提交回复
热议问题