view raw
Vyas Dev Vyas Dev - 6 months ago 80
C# Question

How to avoid flickering in TableLayoutPanel in

I am using a TableLayoutPanel for attendance marking purposes. I have added controls (a Panel and a Label) inside of this TableLayoutPanel and created events for them. In some conditions I have cleared all of the controls and proceeded to bind the same controls in different position of TableLayoutPanel. While re-binding the controls, the TableLayoutPanel flickers and is far too slow in initializing.

Ian Ian

Suspend the layout until you've added all your controls on.

TableLayoutPanel panel = new TabelLayoutPanel();

// add controls


Also look at using Double Buffering. You'll have to create a sub-class of the TableLayoutPanel. See an example here.