# scheduler-special-dates

> SfCalendar that decorates a set of holidays and observances as special date cells with an icon, a tool tip and a description label.

**Framework:** winforms  **Component:** Scheduler  **Variant:** special-dates

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/winforms/scheduler-special-dates.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.SfInput.WinForms
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/scheduler-special-dates/scheduler.Designer.cs

```cs
﻿#region Copyright Syncfusion Inc. 2001-2019.
// Copyright Syncfusion Inc. 2001-2019. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws. 
#endregion
using Syncfusion.WinForms.Input;
using System;
using System.Collections.Generic;
using System.Drawing;

namespace SpecialDates
{
    partial class Form1
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #region Windows Form Designer generated code

        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {            
            this.panel6 = new System.Windows.Forms.Panel();
            this.panel2 = new System.Windows.Forms.Panel();
            this.borderPanel1 = new System.Windows.Forms.Panel();
            this.label3 = new System.Windows.Forms.Label();
            this.label2 = new System.Windows.Forms.Label();
            this.sfCalendar = new Syncfusion.WinForms.Input.SfCalendar();
            this.borderPanel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // panel6
            // 
            this.panel6.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238)))));
            this.panel6.Dock = System.Windows.Forms.DockStyle.Right;
            this.panel6.Location = new System.Drawing.Point(831, 0);
            this.panel6.Name = "panel6";
            this.panel6.Size = new System.Drawing.Size(1, 34);
            this.panel6.TabIndex = 1;
            // 
            // panel2
            // 
            this.panel2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(238)))), ((int)(((byte)(238)))), ((int)(((byte)(238)))));
            this.panel2.Dock = System.Windows.Forms.DockStyle.Top;
            this.panel2.Location = new System.Drawing.Point(0, 34);
            this.panel2.Name = "panel2";
            this.panel2.Size = new System.Drawing.Size(832, 1);
            this.panel2.TabIndex = 1;
            // 
            // borderPanel1
            // 
            this.borderPanel1.Controls.Add(this.label3);
            this.borderPanel1.Controls.Add(this.label2);
            this.borderPanel1.Controls.Add(this.sfCalendar);
            this.borderPanel1.Location = new System.Drawing.Point(12, 60);
            this.borderPanel1.Name = "borderPanel1";
            this.borderPanel1.Size = new System.Drawing.Size(684, 526);
            this.borderPanel1.TabIndex = 2;
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label3.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
            this.label3.Location = new System.Drawing.Point(252, 449);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(50, 20);
            this.label3.TabIndex = 25;            

            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Font = new System.Drawing.Font("Segoe UI Semibold", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
            this.label2.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(51)))), ((int)(((byte)(51)))), ((int)(((byte)(51)))));
            this.label2.Location = new System.Drawing.Point(150, 449);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(106, 20);
            this.label2.TabIndex = 17;
            this.label2.Text = "Selected Date:";
            // 
            // sfCalendar
            // 
                                  
            this.sfCalendar.FooterHeight = 30;
            this.sfCalendar.HeaderHeight = 70;
            this.sfCalendar.Location = new System.Drawing.Point(154, 64);          
            this.sfCalendar.Name = "sfCalendar";
            this.sfCalendar.NumberOfWeeksInView = 6;        
            this.sfCalendar.ShowWeekNumbers = false;
            this.sfCalendar.Size = new System.Drawing.Size(378, 354);            
            this.sfCalendar.TabIndex = 16;
            this.sfCalendar.Text = "sfCalendar1";
            this.sfCalendar.TrailingDatesVisible = true;          
            this.sfCalendar.MaxDate = new System.DateTime(2100, 01, 01);
            this.sfCalendar.MinDate = new DateTime(1900, 01, 01);            
          
           

            // 
            // Form1
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.BackColor = ColorTranslator.FromHtml("#f3f3f3");
            this.ClientSize = new System.Drawing.Size(832, 661);
            this.Controls.Add(this.borderPanel1);
            this.Controls.Add(this.panel2);
            this.Name = "Form1";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "Special Dates";
            this.Load += new System.EventHandler(this.Form1_Load);
            this.sfCalendar.SelectionChanged += SfCalendar_SelectionChanged;            
            this.borderPanel1.ResumeLayout(false);
            this.borderPanel1.PerformLayout();
            this.ResumeLayout(false);
            this.MaximizeBox = false;
            this.MaximumSize = this.Size;
            this.MinimumSize = this.Size;
        }

        #endregion

        private System.Windows.Forms.Panel panel2;
        private System.Windows.Forms.Panel panel6;
        private System.Windows.Forms.Panel borderPanel1;
        private Syncfusion.WinForms.Input.SfCalendar sfCalendar;
        private System.Windows.Forms.Label label3;
        private System.Windows.Forms.Label label2;
    }
}

```

### src/components/scheduler-special-dates/scheduler.cs

```cs
using Syncfusion.WinForms.Controls;
using Syncfusion.WinForms.Input;
using Syncfusion.Windows.Forms;
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;

namespace SpecialDates
{
    /// <summary>
    /// Demonstrates the SfCalendar special dates: a set of observances is marked
    /// on the calendar with an icon, a description and a tool tip.
    /// </summary>
    public partial class Form1 : SfForm
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Form1"/> class.
        /// </summary>
        public Form1()
        {
            InitializeComponent();
        }

        #region Functions

        /// <summary>
        /// Centers the calendar panel inside the form.
        /// </summary>
        public void MakePanelCenter()
        {
            this.borderPanel1.Location = new Point(
                this.ClientSize.Width / 2 - borderPanel1.Size.Width / 2,
                this.ClientSize.Height / 2 - borderPanel1.Size.Height / 2);
        }

        /// <summary>
        /// Builds the list of special dates that are shown on the calendar.
        /// </summary>
        public void ConfigureSpecialDate()
        {
            List<SpecialDate> specialDates = new List<SpecialDate>();

            foreach (SpecialDatesDataSource.SpecialDateInfo observance in SpecialDatesDataSource.Observances)
            {
                SpecialDate specialDate = new SpecialDate
                {
                    BackColor = SpecialDatesDataSource.BackColor,
                    Font = SpecialDatesDataSource.Font,
                    ForeColor = SpecialDatesDataSource.ForeColor,
                    Image = SpecialDatesDataSource.GetImage(observance),
                    ImageAlign = ContentAlignment.MiddleCenter,
                    IsDateVisible = false,
                    TextAlign = ContentAlignment.MiddleCenter,
                    TextImageRelation = TextImageRelation.TextBeforeImage,
                    Value = observance.Value,
                    Description = observance.Description
                };

                specialDates.Add(specialDate);
            }

            this.sfCalendar.SpecialDates = specialDates;
            this.sfCalendar.SelectedDate = SpecialDatesDataSource.SelectedDate;
        }

        #endregion

        #region Events

        /// <summary>
        /// Prepares the form when it is loaded.
        /// </summary>
        private void Form1_Load(object sender, EventArgs e)
        {
            MakePanelCenter();
            ConfigureSpecialDate();
            this.sfCalendar.ShowToolTip = true;
            this.sfCalendar.ToolTipOpening += SfCalendar_ToolTipOpening;
            SkinManager.SetVisualStyle(this, "Office2019Colorful");
        }

        /// <summary>
        /// Shows the tool tip only for the special dates of the month view.
        /// </summary>
        private void SfCalendar_ToolTipOpening(SfCalendar sender, Syncfusion.WinForms.Input.Events.ToolTipOpeningEventArgs e)
        {
            if (e.ViewType == Syncfusion.WinForms.Input.Enums.CalendarViewType.Month && !e.IsSpecialDate)
            {
                e.Handled = true;
            }

            if (e.ViewType == Syncfusion.WinForms.Input.Enums.CalendarViewType.Year)
            {
                e.Handled = true;
            }

            if (e.ViewType == Syncfusion.WinForms.Input.Enums.CalendarViewType.Decade)
            {
                e.Handled = true;
            }

            if (e.ViewType == Syncfusion.WinForms.Input.Enums.CalendarViewType.Century)
            {
                e.Handled = true;
            }
        }

        /// <summary>
        /// Keeps the calendar panel centered while the form is resized.
        /// </summary>
        protected override void OnSizeChanged(EventArgs e)
        {
            MakePanelCenter();
            base.OnSizeChanged(e);
        }

        /// <summary>
        /// Shows the description of the selected date when it is a special date.
        /// </summary>
        private void SfCalendar_SelectionChanged(object sender, Syncfusion.WinForms.Input.Events.SelectionChangedEventArgs e)
        {
            if (this.sfCalendar.SelectedDate == null)
            {
                this.label3.Text = "None";
                return;
            }

            SpecialDatesDataSource.SpecialDateInfo observance =
                SpecialDatesDataSource.FindByDate(this.sfCalendar.SelectedDate.Value);

            if (observance != null)
            {
                this.label3.Text = this.sfCalendar.SelectedDate.Value.ToLongDateString() +
                                  " ( " + observance.Description + " )";
            }
            else
            {
                this.label3.Text = this.sfCalendar.SelectedDate.Value.ToLongDateString();
            }
        }

        #endregion
    }
}

```
