Hello,
I'm building an interface showing many users controls (mainly Labels and Buttons) but the result is rather slow.
Here is a basic sample of the code:
Could you please advise on the best way to optimize my code ?
Thank you
I'm building an interface showing many users controls (mainly Labels and Buttons) but the result is rather slow.
Here is a basic sample of the code:
Code:
Panel myPanel = new Panel();
int nbrPPL=15;
for (int k=0; k < nbrPPL; k++)
{
Case[k] = new Label();
Case[k].Location=...
Case[k].Size=...
Case[k].Name=...
CaseH[k] = new Label();
CaseH[k].Location=...
CaseT[k] = new Label();
CaseT[k].Location=...
myPanel.Controls.Add(Case[k]);
myPanel.Controls.Add(CaseT[k]);
myPanel.Controls.Add(CaseH[k]);
}
Controls.Add(myPanel);
Thank you
Comment