public void SelectChange(LocomotiveList01 list) { try { foreach (var it in panList.Controls) { if (it is LocomotiveList01) { LocomotiveList01 l = (LocomotiveList01)it; l.isSelect = false; l.BackColor = Color.Transparent; } } } catch (Exception ex) { RTCore.Environment.ReportError(ex, AccessManager.AccessKey); } }
private void ListDraw(Locomotive.LocomotiveRank?rank) { try { tt.RemoveAll(); panList.Size = new Size(730, 0); panList.Location = new Point(0, 0); int y = 0; foreach (var it in TrainManager.Locomotives) { if (rank != null && it.Rank != rank.GetValueOrDefault()) { continue; } LocomotiveList01 rl = new LocomotiveList01(it, this); rl.Location = new Point(0, y); panList.Controls.Add(rl); y += rl.Height; panList.Size = new Size(730, y); } if (panList.Controls.Count <= 2) { panListBack.AutoScroll = false; panListBack.Size = new Size(730, panListBack.Height); } else { panListBack.AutoScroll = true; panListBack.Size = new Size(750, panListBack.Height); } } catch (Exception ex) { RTCore.Environment.ReportError(ex, AccessManager.AccessKey); } }