private void loadAllShop() { foreach (OShop item in User.SHOPS) { UCItemShopSpread frm = new UCItemShopSpread(); frm.Shop = item; addShopToPanel(frm); } }
private void addShopToPanel(UCItemShopSpread frm) { frm.Location = new Point(10, (lsAllShopItem.Count * frm.Height) + (lsAllShopItem.Count * 10) + 10); frm.Width = xtraScrollableShop.Width - 30; lsAllShopItem.Add(frm); xtraScrollableShop.Invoke((MethodInvoker) delegate { xtraScrollableShop.Controls.Clear(); }); foreach (var item in lsAllShopItem) { xtraScrollableShop.Invoke((MethodInvoker) delegate { xtraScrollableShop.Controls.Add(item); }); } }