Days of the week; values can be combined.
| Name | Value | Description |
|---|---|---|
| daysSftDateNone | 0 | None |
| daysSftDateSunday | 1 | Sunday |
| daysSftDateMonday | 2 | Monday |
| daysSftDateTuesday | 4 | Tuesday |
| daysSftDateWednesday | 8 | Wednesday |
| daysSftDateThursday | 16 | Thursday |
| daysSftDateFriday | 32 | Friday |
| daysSftDateSaturday | 64 | Saturday |
| daysSftDateWeekend | 65 | Saturday and Sunday |
} else if (sender == checkClearButton) {
ForEachCalendar(cal => cal.ShowClearButton = checkClearButton.Checked);
} else if (sender == checkHolidays) {
SetHolidays(checkHolidays.Checked);
} else if (sender == checkWeekends) {
// the DayFormatting event colors the days; RefreshDays asks for them again
ForEachCalendar(cal => cal.RefreshDays());
} else if (sender == checkDisableWeekends) {
ForEachCalendar(cal => cal.DisabledDaysOfWeek = checkDisableWeekends.Checked ? SftDateDaysConstants.daysSftDateWeekend : SftDateDaysConstants.daysSftDateNone);
} else if (sender == checkRangeSelect) {
sftCalendar.SelectionMode = checkRangeSelect.Checked ? SftDateSelectionModeConstants.selectionSftDateRange : SftDateSelectionModeConstants.selectionSftDateSingle;
ShowSelection();
} else if (sender == checkThisYear) {
DateTime first = new DateTime(DateTime.Today.Year, 1, 1), last = new DateTime(DateTime.Today.Year, 12, 31);
ForEachControl(f => {
f.MinDate = checkThisYear.Checked ? first : minDate;
ElseIf sender Is checkClearButton Then
ForEachCalendar(Sub(cal) cal.ShowClearButton = checkClearButton.Checked)
ElseIf sender Is checkHolidays Then
SetHolidays(checkHolidays.Checked)
ElseIf sender Is checkWeekends Then
' the DayFormatting event colors the days; RefreshDays asks for them again
ForEachCalendar(Sub(cal) cal.RefreshDays())
ElseIf sender Is checkDisableWeekends Then
ForEachCalendar(Sub(cal) cal.DisabledDaysOfWeek = If(checkDisableWeekends.Checked, SftDateDaysConstants.daysSftDateWeekend, SftDateDaysConstants.daysSftDateNone))
ElseIf sender Is checkRangeSelect Then
sftCalendar.SelectionMode = If(checkRangeSelect.Checked, SftDateSelectionModeConstants.selectionSftDateRange, SftDateSelectionModeConstants.selectionSftDateSingle)
ShowSelection()
ElseIf sender Is checkThisYear Then
Dim first As New Date(Date.Today.Year, 1, 1), last As New Date(Date.Today.Year, 12, 31)
ForEachControl(Sub(f)
f.MinDate = If(checkThisYear.Checked, first, minDate)See Also Object Hierarchy | DisabledDaysOfWeek | Validation