Search
Calendar.DayOfWeekStyles Property
See Also
 






Gets a collection of DayOfWeekStyle objects that allow customizing the appearance of specific days of the week in the calendar.

Namespace: MindFusion.Scheduling
Assembly: MindFusion.Scheduling

 Syntax

C#  Copy Code

public List<DayOfWeekStyle> DayOfWeekStyles { get; }

Visual Basic  Copy Code

Public ReadOnly Property DayOfWeekStyles As List(Of DayOfWeekStyle)

 Property Value

A list of DayOfWeekStyle objects.

 Remarks

Add DayOfWeekStyle objects to this collection to specify a distinct style for a day of the week. If several styles are defined for the same day, the one having the highest Priority is used.

 Example

The following example demonstrates how to make all weekend days to be colored differently. The example assumes that calendar references an existing Calendar object.

C#  Copy Code

calendar.CurrentView = CalendarView.Month;

DayOfWeekStyle s;

s = new DayOfWeekStyle();
s.DayOfWeek = DayOfWeek.Saturday;
s.Style = new Style();
s.Style.HeaderBrush = new MindFusion.Drawing.SolidBrush(Colors.PaleGreen);
calendar.DayOfWeekStyles.Add(s);

s = new DayOfWeekStyle();
s.DayOfWeek = DayOfWeek.Sunday;
s.Style = new Style();
s.Style.HeaderBrush = new MindFusion.Drawing.SolidBrush(Colors.PaleGreen);
calendar.DayOfWeekStyles.Add(s);

Visual Basic  Copy Code

calendar.CurrentView = CalendarView.Month

Dim s As DayOfWeekStyle s

s = New DayOfWeekStyle()
s.DayOfWeek = DayOfWeek.Saturday
s.Style = New Style()
s.Style.HeaderBrush = New MindFusion.Drawing.SolidBrush(Colors.PaleGreen)
calendar.DayOfWeekStyles.Add(s)

s = New DayOfWeekStyle()
s.DayOfWeek = DayOfWeek.Sunday
s.Style = New Style()
s.Style.HeaderBrush = New MindFusion.Drawing.SolidBrush(Colors.PaleGreen)
calendar.DayOfWeekStyles.Add(s)

 See Also