Defines the days of the week that cannot be selected.
Get
| C# | SftDateDaysConstants Days = object.DisabledDaysOfWeek; |
| VB.NET | Days = object.DisabledDaysOfWeek As SftDateDaysConstants |
| C++ | enum SftDateDaysConstants Days = object->DisabledDaysOfWeek; enum SftDateDaysConstants Days = object->GetDisabledDaysOfWeek(); |
| C | HRESULT object->get_DisabledDaysOfWeek(enum SftDateDaysConstants* Days); |
Put
| C# | SftDateDaysConstants object.DisabledDaysOfWeek = Days; |
| VB.NET | object.DisabledDaysOfWeek = Days As SftDateDaysConstants |
| C++ | enum SftDateDaysConstants object->DisabledDaysOfWeek = Days; void object->PutDisabledDaysOfWeek(enum SftDateDaysConstants Days); |
| C | HRESULT object->put_DisabledDaysOfWeek(enum SftDateDaysConstants Days); |
object
Days
Defines the days of the week that cannot be selected.
| 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 |
The DisabledDaysOfWeek property defines the days of the week a calendar shows disabled, a combination of SftDateDaysConstants values. The default is daysSftDateNone. The user cannot select disabled days; they are shown in the color DisabledForeColor. p Single days are disabled using special dates (SftDateSpecialDate.Enabled) or the DayFormatting event. A value typed into a date field control is not limited by disabled days; the ValueValidating event can refuse it. p The setting applies to a month calendar control and to the dropdown calendar of a date field control.
} 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 SftDateCalendar Object | Object Hierarchy | Validation