I am using TableLayoutPanel in C# (Forms).
My table is pretty big with its 33 columns and 8 rows. All cells contain Label-objects.
I have already set DoubleBuffered = true; of my TableLayoutPanel by creating a new subclass:
public class DoubleBufferedTableLayoutPanel : TableLayoutPanel
{
public DoubleBufferedTableLayoutPanel()
{
DoubleBuffered = true;
}
}
If a user presses button X, all cell-controls are deleted and other labels are loaded into the table (from an array which contains all Label objects).
DEL: this.table.Controls.Remove(this.table.GetControlFromPosition(col, row));
ADD: this.table.Controls.Add(this.labelArray[row, (col+pos)], col, row);
Everything works fine, except that the progress of deleting the controls and adding the new ones takes five to ten seconds.
Is there a way other than to set DoubleBuffered = true in order to speed up this process?
Add/Removecalls betweenSuspendLayout&ResumeLayoutcalls? - olydis