How to eliminate flicker in Windows.Forms custom control when scrolling?

后端 未结 4 1591
攒了一身酷
攒了一身酷 2020-12-01 19:22

I want to create a custom control in C#. But every time I have to fully redraw my control, it flickers, even if I use double buffering (drawing to an Image first, and blitti

4条回答
  •  生来不讨喜
    2020-12-01 20:05

    I pulled this from a working C# program. Other posters have syntax errors and clearly copied from C++ instead of C#

    SetStyle(ControlStyles.OptimizedDoubleBuffer | 
                            ControlStyles.UserPaint |
                            ControlStyles.AllPaintingInWmPaint, true);
    

提交回复
热议问题