Here is a tip shared by Kannan, a colleague of mine on how to avoid flickering when rendering controls dynamically in a Windows Application.
Enable double buffering, so that the flickering does not happen.
Add the following after the ‘InitializeComponent’ method.
SetStyle(ControlStyles.UserPaint, true);
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
SetStyle(ControlStyles.DoubleBuffer, true);
That’s it.
Leave a reply to Windows Programmers Cancel reply