private void LoadUserControlLine() { var linePanels = new List<LineControl>(); for (int i = 0; i < _lineService.GetLines().Count; i++) { var mp = new LineControl(); linePanels.Add(mp); var line = _lineService.GetLines().ElementAtOrDefault(i); if (line != null) { mp.LineName = line.Name_line; mp.Name = "Panel" + line.Id_customer + i; } mp.Location = new Point(10, 160 * i); mp.Dock = DockStyle.Top; linePanels.Add(mp); } foreach (var p in linePanels) { this.SuspendLayout(); this.Controls.Add(p); this.ResumeLayout(); } }
private void LoadUserControlLine() { var linePanels = new List <LineControl>(); for (int i = 0; i < _lineService.GetLines().Count; i++) { var mp = new LineControl(); linePanels.Add(mp); var line = _lineService.GetLines().ElementAtOrDefault(i); if (line != null) { mp.LineName = line.Name_line; mp.Name = "Panel" + line.Id_customer + i; } mp.Location = new Point(10, 160 * i); mp.Dock = DockStyle.Top; linePanels.Add(mp); } foreach (var p in linePanels) { this.SuspendLayout(); this.Controls.Add(p); this.ResumeLayout(); } }