In my application I really needed to place a lot of controls (label, textbox, domainupdown) in a nice order. So I went ahead and used some nested TableLayoutPanel
. The problem now is, this form responds very slow to most of events (resize, maximize, minimize and ...) it takes really up to 5 seconds for controls within the tables to get resized, redrawed to the new size of form.
I am putting a finger in my eye now! If this form is that slow on my home PC (i7@4GHz and a good graphic card) what it will do tommorow on the old P4 computer at work?
I even tried to use the code below but it does absoloutly nothing, if it is not slowing it down more!
private void FilterForm_ResizeBegin(object sender, EventArgs e)
{
foreach(TableLayoutPanel tlp in panelFilters.Controls)
{
if(tlp != null)
{
tlp.SuspendLayout();
}
}
}
private void FilterForm_ResizeEnd(object sender, EventArgs e)
{
foreach (TableLayoutPanel tlp in panelFilters.Controls)
{
if (tlp != null)
{
tlp.ResumeLayout();
}
}
}
Please let me know if there is a trick to make tablelayoutpanel to work faster...or if you know a better approach to lay down about hundred of controls nicely aligned.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…