2

I have a TableLayoutPanel where I do some Drag&Drop stuff with the controls inside the layout. Unfortunately the controls are flickering after the drop action. I tried DoubleBuffered=true on all controls and a lot of other things. I also tried this solution: How to fix the flickering in User controls. And actually it works pretty well with the mentioned CreateParams. But only until I resize the form. It seems that windows forgets the WS_EX_COMPOSIET flag after a resize. It appears only with the aero theme. Without aero it keeps the settings of the CreateParams after a resize.

Is there any way to prevent flickering when the aero theme is turned on?

Community
  • 1
  • 1
  • You can try to set `WS_EX_LAYERED` flag. See also: [Redraw issue on Windows10 with DoubleBuffering](https://stackoverflow.com/q/51824224/7713750) – Rekshino Oct 02 '18 at 07:16

1 Answers1

1

on the the form resize Events (onResizeBegin & on ResizeEnd) use the following code :

protected override void OnResizeBegin(EventArgs e) 
 {
    SuspendLayout();
    base.OnResizeBegin(e);
 }

protected override void OnResizeEnd(EventArgs e) 
 {
    ResumeLayout();
    base.OnResizeEnd(e);
 }
  • This was the first thing I did. Unfortunately without success. I got acceptable results with less nested controls. – Robotregent Jul 11 '13 at 16:28