ComponentOne GanttView for WinForms
Setting Back Color of Day
GanttView for WinForms Task-Based Help > Setting Back Color of Day

GanttView enables users to highlight a specific day of week by setting its back color. For instance, the weekends in a gantt view can be highlighted in a different color to distinguish them from workweek. This can be achieved in code by subscribing the PaintDay event and setting the BackColor property to color specific days.

The following image shows a GanttView with weekends highlighted by a different color.

The following code illustrates how to set back color of weekend.

Private Sub gv_PaintDay(sender As Object, e As PaintDayEventArgs)
        If e.[Date].DayOfWeek = DayOfWeek.Saturday 
        OrElse e.[Date].DayOfWeek = DayOfWeek.Sunday Then
            e.BackColor = Color.MistyRose
        End If
    End Sub
 private void gv_PaintDay(object sender, PaintDayEventArgs e)
        {
            if (e.Date.DayOfWeek == DayOfWeek.Saturday || e.Date.DayOfWeek == DayOfWeek.Sunday)
            {
                e.BackColor = Color.MistyRose;
            }
        }