public void RenderSchedule() { if (Io == null) { return; } var se = MainForm.Schedule.Where(p => p.objectid == Io.ObjectID && p.objecttypeid == Io.ObjectTypeID).ToList(); flpSchedule.SuspendLayout(); flpSchedule.Controls.Clear(); int vertScrollWidth = SystemInformation.VerticalScrollBarWidth; var w = flpSchedule.Width - 2; if (se.Count * AlertEventRow.Height >= flpSchedule.Height) { w = w - vertScrollWidth; } foreach (var e in se) { var c = new ScheduleRow(e); c.ScheduleEntryDelete += CScheduleEntryDelete; c.ScheduleEntryEdit += CScheduleEntryEdit; c.MouseOver += CMouseOver; c.Width = w; flpSchedule.Controls.Add(c); flpSchedule.SetFlowBreak(c, true); } flpSchedule.ResumeLayout(true); flpSchedule.HorizontalScroll.Visible = flpSchedule.HorizontalScroll.Enabled = false; }
public void RenderSchedule() { if (Io == null) return; var se = MainForm.Schedule.Where(p => p.objectid == Io.ObjectID && p.objecttypeid == Io.ObjectTypeID).ToList(); flpSchedule.SuspendLayout(); flpSchedule.Controls.Clear(); int vertScrollWidth = SystemInformation.VerticalScrollBarWidth; var w = flpSchedule.Width - 2; if (se.Count*AlertEventRow.Height >= flpSchedule.Height) w = w - vertScrollWidth; foreach (var e in se) { var c = new ScheduleRow(e); c.ScheduleEntryDelete += CScheduleEntryDelete; c.ScheduleEntryEdit += CScheduleEntryEdit; c.MouseOver += CMouseOver; c.Width = w; flpSchedule.Controls.Add(c); flpSchedule.SetFlowBreak(c, true); } flpSchedule.ResumeLayout(true); flpSchedule.HorizontalScroll.Visible = flpSchedule.HorizontalScroll.Enabled = false; }