Table of Contents

Class Calendar

Namespace
Alternet.UI
Assembly
Alternet.UI.Common.dll

The calendar control allows the user to pick a date.

[ControlCategory("Other")]
public class Calendar : CustomDateEdit, IBaseObject, IDisposableObject, ISupportInitialize, IFocusable, ITextProperty, IComponent, IControl, IDisposable, IWin32Window, INotifyDataErrorInfo
Inheritance
Calendar
Implements

Remarks

Examples of how a Calendar can look on different platforms:

Constructors

Calendar()

Initializes a new instance of the Calendar class.

Properties

BackgroundColor

Gets or sets the background color for the control.

ControlKind

Returns control identifier.

FirstDayOfWeek

Gets or sets the day that is considered the beginning of the week.

Font

Gets or sets the font of the text displayed by the control.

ForegroundColor

Gets or sets the foreground color for the control.

HasBorder

Gets or sets a value indicating whether the control has a border.

HeaderColorBg

Gets or sets the background color of the header part of the calendar control.

HeaderColorFg

Gets or sets the foreground color of the header part of the calendar control.

HighlightColorBg

Gets or sets the background highlight color.

HighlightColorFg

Gets or sets the foreground highlight color.

HolidayColorBg

Gets or sets the background color currently used for holiday highlighting.

HolidayColorFg

Gets or sets the foreground color currently used for holiday highlighting.

IsBold

Gets or sets whether control's font is bold.

MarkDateAttr

Gets or sets the ICalendarDateAttr attributes for the marked days.

NoMonthChange

Gets or sets a value indicating whether to disable the month (and, implicitly, the year) changing. Not implemented on all platforms.

SequentalMonthSelect

Gets or sets a value indicating whether to use alternative, more compact, style for the month and year selection controls.

ShowHolidays

Gets or sets a value indicating whether to highlight holidays in the calendar

ShowSurroundWeeks

Gets or sets a value indicating whether to show the neighbouring weeks in the previous and next months. (only generic, always on for the native controls)

ShowWeekNumbers

Gets or sets a value indicating whether to show week numbers on the left side of the calendar.

UseGeneric

Gets or sets a value indicating whether to use generic calendar or native calendar.

Value

Gets or sets the currently selected date.

Methods

CreateDateAttr(CalendarDateBorder)

Creates ICalendarDateAttr instance.

CreateHandler()

Creates a handler for the control.

GetAttr(int)

Returns the ICalendarDateAttr attributes for the given day or null.

HitTest(PointD)

Returns one of Calendar.HitTestResult constants.

Mark(int, bool)

Marks or unmarks the day.

OnDayDoubleClick(EventArgs)

Called when a day was double clicked in the calendar.

OnDayHeaderClick(EventArgs)

Called when the user clicked on the week day header (fired only in generic calendar).

OnPageChanged(EventArgs)

Called when the selected month (and/or year) changed.

OnSelectionChanged(EventArgs)

Called when the selected date changed.

OnWeekNumberClick(EventArgs)

Called when the user clicked on the week of the year number (fired only in generic calendar).

RaiseDayDoubleClick(EventArgs)

Raises DayDoubleClick event and calls OnDayDoubleClick(EventArgs) method.

RaiseDayHeaderClick(EventArgs)

Raises DayHeaderClick event and calls OnDayHeaderClick(EventArgs) method.

RaisePageChanged(EventArgs)

Raises PageChanged event and calls OnPageChanged(EventArgs) method.

RaiseSelectionChanged(EventArgs)

Raises SelectionChanged event and calls OnSelectionChanged(EventArgs) method

RaiseWeekNumberClick(EventArgs)

Raises WeekNumberClick event and calls OnWeekNumberClick(EventArgs) method.

ResetAttr(int)

Clears any attributes associated with the given day.

SelectToday()

Changes Value property to the today date.

SetAttr(int, ICalendarDateAttr?)

Sets the ICalendarDateAttr attributes for the given day.

SetHeaderColors(Color, Color)

Sets values for HeaderColorBg and HeaderColorFg properties.

SetHighlightColors(Color, Color)

Sets values for HighlightColorBg and HighlightColorFg properties.

SetHoliday(int)

Marks the specified day as being a holiday in the current month.

SetHolidayColors(Color, Color)

Sets values for HolidayColorBg and HolidayColorFg properties.

SetRange(DateTime, DateTime)

Sets possible date range in the native control.

Events

DayDoubleClick

Occurs when a day was double clicked in the calendar.

DayHeaderClick

Occurs when the user clicked on the week day header (fired only in generic calendar).

PageChanged

Occurs when the selected month (and/or year) changed.

SelectionChanged

Occurs when the selected date changed.

WeekNumberClick

Occurs when the user clicked on the week of the year number (fired only in generic calendar).