void CreateHorses() { _horseCtrls.ForEach(ctrl => Controls.Remove(ctrl)); _horseCtrls.Clear(); int x = 10, y = 80; foreach (var horse in _keyRaces.Horses.OrderBy(h=>h.RealTimeOdds)) { var ctrl = new HorseCtrl(horse,NumberOfKeyRaces(horse, _keyRaces)); this.Controls.Add(ctrl); ctrl.Location = new Point(x, y); y += ctrl.Height + 20; _horseCtrls.Add(ctrl); } }
private void Connect(Graphics graphics, HorseCtrl hctrl, RaceInfoCtrl rictrl) { var p1 = new Point(hctrl.Left + hctrl.Width, hctrl.Top + hctrl.Height / 2); var p2 = new Point(rictrl.Left, rictrl.Top + rictrl.Height / 2); graphics.DrawLine(_pen, p1, p2); }