I have a problem with the drawing and or the filling speed of my FlowLayoutPanel.
See screenshot.
Can I speedup the process my cashing my images somehow?
Or is there a better alternative to the FlowLayoutPanel?
private void FillPanel()
{
flpServices.Controls.Clear();
prevStatus = 0;
prevRows = 0;
foreach (Jims.Services s in serviceList)
{
PictureBox pt = new PictureBox();
pt.ImageLocation = @""+ imgloc + (int)s.Status + ".png";
pt.SizeMode = PictureBoxSizeMode.StretchImage;
pt.Width = 32;
pt.Height = 32;
pt.Tag = s.App_Name;
pt.Click += new EventHandler(PictureBoxClick);
Label lbl = new Label();
lbl.Text = s.App_Name + ": " + s.Project_Name;
lbl.Width = flpServices.Width - pt.Width - 30;
lbl.Height = 32;
lbl.TextAlign = ContentAlignment.MiddleLeft;
flpServices.Controls.Add(pt);
flpServices.Controls.Add(lbl);
flpServices.SetFlowBreak(lbl, true);
prevRows++;
prevStatus += (int)s.Status;
}
IconChanger();
}