I set up a dialog with several tabs. One of them contains twenty combo boxes, each of which contains more than 100 items, added as follows:
foreach (var x in collection)
{
string text = FormatItem (x);
combo.Items.Add (text);
}
therefore there is nothing unusual in the details. These are simple lines, and the combo boxes are populated when creating the dialog. This happens almost instantly.
However, when the user clicks on the tab containing all of these combined fields for the first time, the GUI freezes for several seconds (and I'm running on a really muscular machine).
I downloaded the symbols for System.Windows.Formsand tried to break into the debugger when the program got stuck. I found a stack trace with the following calls:
System.Windows.Forms.Control.CreateHandle()
System.Windows.Forms.ComboBox.CreateHandle()
System.Windows.Forms.Control.CreateControl(...) x 3
System.Windows.Forms.Control.SetVisibleCore(true)
System.Windows.Forms.TabPage.Visible.set(true)
, WndProc .. , . .
, WinForms. , , - , ? ?
Nota bene: