Calendar Control

A customizable calendar control.

Namespace: LSOne.Controls

Assembly: LSOne.Controls.CalendarControl

Syntax

public partial class CalendarControl : UserControl

 

Constructors

Name Description
CalendarControl() Default constructor

 

Properties

Name

Description

AntiAlias Get or set whether the text in the control is drawn anti-aliased.
BackColor Get or set the back color of the control. This has no effect if UseBackColor is not set to true.
BeforeTodayEndColor Get or set the end color for the "before today color" gradient
BeforeTodayStartColor Get or set the start color for the "before today color" gradient
CancelEventAction Get or set if the events internal action should be canceled.
ClickableOutOfBounds Get or set if the out of bound days (next or previous month) are clickable. This has no effect if the DrawOutOfBounds property is not set to true.
ColoredDays Get a DateDictionary which can be used to add colored days to the calendar.
DrawFrame Get or set if a frame should be drawn around the calendar control.
DrawOutOfBounds Get or set if the days from the next and previous months should be displayed.
FromTodayEndColor Get or set the end color for the "from today color" gradient.
FromTodayStartColor Get or set the start color for the "from today color" gradient.
MondayEnabled Get or set if Mondays are enabled.
MondaySpecial Get or set if Mondays are "special" days.
TuesdayEnabled Get or set if Tuesdays are enabled.
TuesdaySpecial Get or set if Tuesdays are "special" days.
WednesdayEnabled Get or set if Wednesdays are enabled.
WednesdaySpecial Get or set if Wednesdays are "special" days.
ThursdayEnabled Get or set if Thursdays are enabled.
ThursdaySpecial Get or set if Thursdays are "special" days.
FridayEnabled Get or set if Fridays are enabled.
FridaySpecial Get or set if Fridays are "special" days.
SaturdayEnabled Get or set if Saturdays are enabled.
SaturdaySpecial Get or set if Saturdays are "special" days.
SundayEnabled Get or set if Sundays are enabled.
SundaySpecial Get or set if Sundays are "special" days.
MarkedDays Get a DateDictionary which can be used to add marked days to the calendar.
MarkSyle Get or set how marked days are displayed. Uses the MarkedDaysStyle enum.
MaxDate Get or set the maximum date of the control.
MinDate Get or set the minimum date of the control.
SelectedDate Get or set the selected date of the control.
ShowYearArrow Get or set if year arrows should be displayed.
SpecialDays Get a DateDictionary which can be used to add special days to the calendar.
TodayEndColor Get or set the end color for the "today color" gradient.
TodayStartColor Get or set the start color for the "today color" gradient.
UseBackColor Get or set if the BackColor property should be used instead of the default one.
UseBeforeTodayColoring Get or set if the color of all days before the today date should be overridden.
UseFromTodayColoring Get or set if the color of all days after the today date should be overridden.
UseMaxDate Get or set if the control should use the MaxDate property.
UseMinDate Get or set if the control should use the MinDate property.
UseTodayColoring Get or set if the color of the today date should be overridden.

 

Methods

Name Description
SetCulture(CultureInfo culture) Set the culture for the calendar control.
SetDayName(int day, string dayName) Specifies a name for a given day. First parameter is the day number (1 - 7) and the second is the new name of the day.
SetMonthName(int month, string monthName) Specifies a name for a given month. First parameter is the month number (1 - 12) and the second is the new name of the month.

 

Events

Name Description
SelectedChanged Occurs when the selected date is changed.
YearFieldClicked Occurs when the year field is clicked.
DayDoubleClicked Occurs when a day is double clicked. Uses the DayClickDelegate which passes the day, month, year and day of week as parameters.
DayClicked Occurs when a day is clicked. Uses the DayClickDelegate which passes the day, month, year and day of week as parameters.

 

Examples

 

See Source\POS\Services\DialogService\WinFormsTouch\DateSelectionDialog.cs from DevPack for usage examples.