…breakStart=e.TimeItem.Start.AddDays(breakInfo.startsDaysFromStart).Add(e.Diff); DateTime breakStop=breakStart.AddDays(breakInfo.breakLengthInDays); int breakStartPixel=gantt1.DateScaler.TimeToPixel(breakStart); int breakStopPixel=gantt1.DateScaler.TimeToPixel(breakStop); if (gantt1.ScheduleMode) { e.G.FillRectangle(new SolidBrush(Color.Blue),new Rectangle(e.Rect.Left,e.Rect.Top,e.Rect.Width,breakStartPixel-e.Rect.Top)); e.G.FillRectangle(new SolidBrush(Color.Blue),Rectangle.FromLTRB(e.Rect.Left,breakStopPixel,e.Rect.Right,e.Rect.Bottom)); e.G.DrawRectangle(new Pen(Color.Black),e.Rect); } else { e.G.FillRectangle(new SolidBrush(Color.Blue),new Rectangle(e.Rect.Left,e.Rect.Top,breakStartPixel-e.Rect.Left,e.Rect.Height)); e.G.FillRectangle(new SolidBrush(Color.Blue),Rectangle.FromLTRB(breakStopPixel,e.Rect.Top,e.Rect.Right,e.Rect.Bottom)); e.G.DrawRectangle(new Pen(Color.Black),e.Rect); } } }… Continue reading →