Defines how a special date repeats.
Namespace: Softelvdm.SftDateNET
Assembly: Softelvdm.SftDateNET
public enum RecurrenceEnum;
Public Enum RecurrenceEnum
| Name | Description |
|---|---|
| None | The special date applies to its date only. |
| Weekly | The special date applies to every date on the same day of the week. |
| Monthly | The special date applies to the same day of every month. |
| Annually | The special date applies to the same day and month of every year. |
Defines how a special date repeats.
// Special dates repeat every year, month or week, and can be bold, colored, disabled or show a tooltip.
private void checkHolidays_CheckedChanged(object sender, EventArgs e) {
int year = DateTime.Today.Year;
DateTime monday = DateTime.Today.AddDays(-(((int)DateTime.Today.DayOfWeek + 6) % 7));
ForEachCalendar(delegate (CalendarClass calendar) {
calendar.SpecialDates.Clear();
if (!checkHolidays.Checked)
return;
SpecialDateClass day = calendar.SpecialDates.Add(new DateTime(year, 1, 1), RecurrenceEnum.Annually);
day.Bold = true;
day.ForeColor = Color.Firebrick;
day.ToolTip = "New Year's Day";
day = calendar.SpecialDates.Add(new DateTime(year, 7, 4), RecurrenceEnum.Annually);
day.Bold = true;
day.ForeColor = Color.Firebrick;
day.ToolTip = "Independence Day";
' Special dates repeat every year, month or week, and can be bold, colored, disabled or show a tooltip.
Private Sub CheckHolidays_CheckedChanged(ByVal sender As Object, ByVal e As EventArgs) Handles CheckHolidays.CheckedChanged
Dim year As Integer = DateTime.Today.Year
Dim monday As DateTime = DateTime.Today.AddDays(-((CInt(DateTime.Today.DayOfWeek) + 6) Mod 7))
For Each calendar As CalendarClass In AllCalendars()
calendar.SpecialDates.Clear()
If CheckHolidays.Checked Then
Dim day As SpecialDateClass = calendar.SpecialDates.Add(New DateTime(year, 1, 1), RecurrenceEnum.Annually)
day.Bold = True
day.ForeColor = Color.Firebrick
day.ToolTip = "New Year's Day"
day = calendar.SpecialDates.Add(New DateTime(year, 7, 4), RecurrenceEnum.Annually)
day.Bold = True
day.ForeColor = Color.Firebrick
day.ToolTip = "Independence Day"
day = calendar.SpecialDates.Add(New DateTime(year, 12, 25), RecurrenceEnum.Annually)See Also Classes | SftDate/NET 3.0