G
Guest
Hello,
I'm developing an application where the user gets the ability to choose how
the form looks like. What is shown, wich controls to use and all available
properties of those controls.
The data gets pulled from a database.
The only problem I have is the speed. When having a form with 500 controls
it takes about 7-8 seconds to show that form to the user. Which is too slow.
At first my guess was that the database was slowing the app down. Or the
looking up of the types and assembly loading for the controls it self.
But then I ran a little experiment. I created a form with one button on it
with the following event-handler.
void button1_click(object sender, EventArgs e)
{
this.SuspendLayout();
for (int i = 0; i < 1000; ++i)
{
Checkbox temp = new Checkbox();
this.Controls.Add(temp);
}
temp.ResumeLayout();
}
I would say this is real basic stuff, but it turns out that this also needs
7 seconds to show the the new controls.
Is there any way I can speed up this kind of operation?
Best regards,
Ike Casteleyn
I'm developing an application where the user gets the ability to choose how
the form looks like. What is shown, wich controls to use and all available
properties of those controls.
The data gets pulled from a database.
The only problem I have is the speed. When having a form with 500 controls
it takes about 7-8 seconds to show that form to the user. Which is too slow.
At first my guess was that the database was slowing the app down. Or the
looking up of the types and assembly loading for the controls it self.
But then I ran a little experiment. I created a form with one button on it
with the following event-handler.
void button1_click(object sender, EventArgs e)
{
this.SuspendLayout();
for (int i = 0; i < 1000; ++i)
{
Checkbox temp = new Checkbox();
this.Controls.Add(temp);
}
temp.ResumeLayout();
}
I would say this is real basic stuff, but it turns out that this also needs
7 seconds to show the the new controls.
Is there any way I can speed up this kind of operation?
Best regards,
Ike Casteleyn