I am making a window-shaped application, and basically my screen is divided into 3 parts, for example
=========================================================================== Top panel (it doesn't flicker) =========================================================================== || || 'it has a panel & panel contains a table layout,this tabble layout' || || 'has a picture box and a label, picture & text of label is' || ||'changed on the click of side bar menu' (PROB: this flickers a lot) ||side bar ||============================================================== ||(doesn't ||'this part also has a panel and panel contains different table' ||flicker) ||'layouts and on the click of a menu, related table layout is shown and' || ||'some of the parts of table layout are created dynamically.' || || || || (PROB: this flickers a lot) || ||
I searched a lot and found this solution everywhere and I tried this
public constructor() { InitializeComponent(); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.DoubleBuffered = true; DoubleBuffered = true; SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.ContainerControl | ControlStyles.OptimizedDoubleBuffer | ControlStyles.SupportsTransparentBackColor , true); }
I also tried this
protected override CreateParams CreateParams { get { CreateParams handleParam = base.CreateParams; handleParam.ExStyle |= 0x02000000;
it changes the entire background of my screen to black.
but the problem remains the same, can someone tell me how to solve this problem and where am I making a mistake? Thank you very much in advance.
Mogli source share