How can I draw on Panel so it does not blink?

后端 未结 2 1881
执笔经年
执笔经年 2021-01-21 02:59

This is my code. When I move cursor over Form it works, circle is moving but it is blinking. How can I fix this?

public partial class Preprocesor : Form
{
    in         


        
2条回答
  •  无人及你
    2021-01-21 03:19

    How bout overriding a panel user control and set Doublebuffered to true?

    public partial class BufferPanel : Panel
    {
        public BufferPanel()
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            UpdateStyles();
        }
    }
    

提交回复
热议问题