An instance of the CalendarClass class defines the layout, behavior and appearance of a calendar.
The SftCalendar control and the dropdown of the SftDate control use the settings of their SftDate.Calendar property. All colors default to Color.Empty, which selects a color that follows the control's dark mode and high contrast settings.
Namespace: Softelvdm.SftDateNET
Assembly: Softelvdm.SftDateNET
Inheritance
public class CalendarClass : System.ComponentModel.INotifyPropertyChanged;
Public Class CalendarClass
Implements System.ComponentModel.INotifyPropertyChangedThis class cannot be instantiated.
![]() | AllowedViews | Defines the views the user can switch to. |
![]() | BackColor | Defines the background color. |
![]() | BorderColor | Defines the color of the line below the names of the days of the week. |
![]() | ClearText | Defines the text of the Clear button. |
![]() | DayOfWeekForeColor | Defines the color of the names of the days of the week. |
![]() | DisabledDaysOfWeek | Defines the days of the week that cannot be selected. |
![]() | DisabledForeColor | Defines the color of days that cannot be selected. |
![]() | FirstDayOfWeek | Defines the first day of the week. |
![]() | Font | Defines the font of the days. |
![]() | ForeColor | Defines the color of the days. |
![]() | HighlightToday | Defines whether today's date is highlighted. |
![]() | HotBackColor | Defines the background color of the day under the mouse. |
![]() | InitialView | Defines the view the calendar starts with. |
![]() | MaxRangeDays | Defines the largest number of days a range can include. |
![]() | MonthsAcross | Defines the number of months shown side by side. |
![]() | MonthsDown | Defines the number of months shown one below the other. |
![]() | RangeBackColor | Defines the background color of the days between the first and last day of a range. |
![]() | ScrollMonths | Defines the number of months the previous and next buttons scroll. |
![]() | SelectedBackColor | Defines the background color of selected days. |
![]() | SelectedForeColor | Defines the text color of selected days. |
![]() | ShowClearButton | Defines whether the Clear button is shown below the calendar. |
![]() | ShowTodayButton | Defines whether the Today button is shown below the calendar. |
![]() | ShowTrailingDates | Defines whether the days of the previous and next month are shown before and after a month. |
![]() | ShowWeekNumbers | Defines whether week numbers are shown. |
![]() | SpecialDates | Returns the collection of special dates. |
![]() | TitleBackColor | Defines the background color of the titles. |
![]() | TitleFont | Defines the font of the titles. |
![]() | TitleForeColor | Defines the text color of the titles and the navigation buttons. |
![]() | TodayColor | Defines the color that marks today's date. |
![]() | TodayDate | Defines the date the calendar treats as today. |
![]() | TodayText | Defines the text of the Today button. |
![]() | TrailingForeColor | Defines the color of the days of the previous and next month. |
![]() | WeekendForeColor | Defines the color of Saturdays and Sundays. |
![]() | WeekNumberBackColor | Defines the background color of the week numbers. |
![]() | WeekNumberForeColor | Defines the color of the week numbers. |
![]() | WeekNumberRule | Defines how week numbers are calculated. |
![]() ![]() | Equals | Determines whether the specified object is equal to the current object. |
![]() ![]() | Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. |
![]() ![]() | GetHashCode | Serves as the default hash function. |
![]() ![]() | GetType | Gets the Type of the current instance. |
![]() ![]() | MemberwiseClone | Creates a shallow copy of the current Object. |
![]() ![]() ![]() | ReferenceEquals | Determines whether the specified Object instances are the same instance. |
![]() | ToString | Returns a string that represents the object. |
![]() | PropertyChanged | Occurs when a property of the calendar settings changes. |
private void FillCombo(ComboBox combo, Type enumType, object current) {
foreach (object value in Enum.GetValues(enumType))
combo.Items.Add(value);
combo.SelectedItem = current;
}
// The options apply to all fields and the calendar; a field's Calendar property defines its dropdown calendar.
private void ForEachCalendar(Action<CalendarClass> action) {
foreach (SftDate field in fields)
action(field.Calendar);
action(sftCalendar1.Calendar);
}
private CultureInfo SelectedCulture() {
CultureInfo culture;
switch (comboCulture.SelectedIndex) {
Private Sub FillCombo(ByVal combo As ComboBox, ByVal enumType As Type, ByVal current As Object)
For Each value As Object In [Enum].GetValues(enumType)
combo.Items.Add(value)
Next
combo.SelectedItem = current
End Sub
' The options apply to all fields and the calendar; a field's Calendar property defines its dropdown calendar.
Private Iterator Function AllCalendars() As IEnumerable(Of CalendarClass)
' Handles clauses run while InitializeComponent sets the designer values, before the constructor fills fields
If fields Is Nothing Then Return
For Each field As SftDate In fields
Yield field.Calendar
Next
Yield SftCalendar1.Calendar
End FunctionSee Also Classes | SftDate/NET 3.0