Gets a collection of DateStyle objects that allow customizing the appearance of specific months in the calendar.
Namespace: MindFusion.Scheduling
Assembly: MindFusion.Scheduling
Syntax
C#
Copy Code
|
---|
public List<DateStyle> MonthStyles { get; } |
Visual Basic
Copy Code
|
---|
Public ReadOnly Property MonthStyles As List(Of DateStyle) |
Property Value
Example
The following example creates a custom style for the current month. The example assumes that calendar references existing Calendar control.
C#
Copy Code
|
---|
// Create the custom date style DateStyle dateStyle = new DateStyle();
// Change the brush used to fill the header contents dateStyle.Style.HeaderBrush = new MindFusion.Drawing.LinearGradientBrush( Colors.LightSteelBlue, Colors.SteelBlue, 90);
// Set the time range of the style to span the whole month DateTime today = DateTime.Today; dateStyle.From = new DateTime(today.Year, today.Month, 1); dateStyle.To = new DateTime(today.Year, today.Month, DateTime.DaysInMonth(today.Year, today.Month));
// Add the style calendar.MonthStyles.Add(dateStyle); |
Visual Basic
Copy Code
|
---|
' Create the custom date style Dim dateStyle As New DateStyle()
' Change the brush used to fill the header contents dateStyle.Style.HeaderBrush = _ New MindFusion.Drawing.LinearGradientBrush( _ Colors.LightSteelBlue, Colors.SteelBlue, 90)
' Set the time range of the style to span the whole month Dim today As DateTime = DateTime.Today dateStyle.From = New DateTime(today.Year, today.Month, 1) dateStyle.To = New DateTime(today.Year, today.Month, _ DateTime.DaysInMonth(today.Year, today.Month))
' Add the style calendar.MonthStyles.Add(dateStyle) |
See Also