PocketPlanner Programmer's Guide

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.Compact
Assembly: PocketPlanner

 Syntax

C#

public DayOfWeekStyleCollection DayOfWeekStyles { get; }

Visual Basic

Public ReadOnly Property DayOfWeekStyles As DayOfWeekStyleCollection

 Property Value

An instance of the DayOfWeekStyleCollection class.

 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#

calendar.CurrentView = CalendarView.SingleMonth;

DayOfWeekStyle s;

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

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

Visual Basic

calendar.CurrentView = CalendarView.SingleMonth

Dim s As DayOfWeekStyle s

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

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

 See Also