{
  "$schema": "https://ai.syncfusion.com/schema/registry-item.json",
  "name": "scheduler-cell-customization",
  "framework": "winforms",
  "type": "registry:component",
  "component": "Scheduler",
  "variant": "cell-customization",
  "dependencies": [
    "Syncfusion.SfInput.WinForms"
  ],
  "description": "SfCalendar whose month cells show per-day appointment markers and whose year view swaps in a custom icon, drawn through the DrawCell event.",
  "meta": {
    "essentialStudioRelease": "2026 Volume 3 (v35.1.37)",
    "license": "commercial-or-community",
    "licenseNote": "The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md",
    "requiresLicenseKey": true,
    "requiresServerEndpoint": false,
    "platformIndex": "https://ai.syncfusion.com/winforms/llms.txt",
    "skillPack": "syncfusion/winforms-ui-components-skills",
    "docs": "https://ai.syncfusion.com/gallery/winforms/scheduler-cell-customization.md"
  },
  "files": [
    {
      "target": "src/components/scheduler-cell-customization/scheduler.Designer.cs",
      "content": "﻿#region Copyright Syncfusion Inc. 2001-2018.\n// Copyright Syncfusion Inc. 2001-2018. All rights reserved.\n// Use of this code is subject to the terms of our license.\n// A copy of the current license can be obtained at any time by e-mailing\n// licensing@syncfusion.com. Any infringement will be prosecuted under\n// applicable laws. \n#endregion\nusing System.Drawing;\n\nnamespace CellCustomization\n{\n    partial class Form1\n    {\n        /// <summary>\n        /// Required designer variable.\n        /// </summary>\n        private System.ComponentModel.IContainer components = null;\n\n        /// <summary>\n        /// Clean up any resources being used.\n        /// </summary>\n        /// <param name=\"disposing\">true if managed resources should be disposed; otherwise, false.</param>\n        protected override void Dispose(bool disposing)\n        {\n            if (disposing && (components != null))\n            {\n                components.Dispose();\n            }\n            base.Dispose(disposing);\n        }\n\n        #region Windows Form Designer generated code\n\n        /// <summary>\n        /// Required method for Designer support - do not modify\n        /// the contents of this method with the code editor.\n        /// </summary>\n        private void InitializeComponent()\n        {\n            this.panel4 = new System.Windows.Forms.Panel();\n            this.sfCalendar1 = new Syncfusion.WinForms.Input.SfCalendar();\n            this.panel2 = new System.Windows.Forms.Panel();\n            this.panel3 = new System.Windows.Forms.Panel();\n            this.flowLayoutPanel1 = new System.Windows.Forms.FlowLayoutPanel();\n            this.panel5 = new System.Windows.Forms.Panel();\n            this.panel4.SuspendLayout();\n            this.panel2.SuspendLayout();\n            this.panel3.SuspendLayout();\n            this.SuspendLayout();\n            // \n            // panel4\n            // \n            this.panel4.Controls.Add(this.panel3);\n            this.panel4.Controls.Add(this.sfCalendar1);\n            this.panel4.Dock = System.Windows.Forms.DockStyle.Fill;\n            this.panel4.Location = new System.Drawing.Point(0, 0);\n            this.panel4.Name = \"panel4\";\n            this.panel4.Size = new System.Drawing.Size(878, 653);\n            this.panel4.TabIndex = 1;\n            // \n            // sfCalendar1\n            // \n            this.sfCalendar1.Culture = new System.Globalization.CultureInfo(\"en-US\");\n            this.sfCalendar1.Location = new System.Drawing.Point(84, 63);\n            this.sfCalendar1.MaxDate = new System.DateTime(9999, 12, 31, 23, 59, 59, 999);\n            this.sfCalendar1.Name = \"sfCalendar1\";\n            this.sfCalendar1.Size = new System.Drawing.Size(518, 461);\n            this.sfCalendar1.TabIndex = 0;\n            this.sfCalendar1.Text = \"sfCalendar1\";\n            this.sfCalendar1.ThemeName = null;\n            // \n            // panel2\n            // \n            this.panel2.Controls.Add(this.panel5);\n            this.panel2.Controls.Add(this.panel4);\n            this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;\n            this.panel2.Location = new System.Drawing.Point(2, 30);\n            this.panel2.Name = \"panel2\";\n            this.panel2.Size = new System.Drawing.Size(878, 653);\n            this.panel2.TabIndex = 1;\n            // \n            // panel3\n            // \n            this.panel3.Controls.Add(this.flowLayoutPanel1);\n            this.panel3.Location = new System.Drawing.Point(660, 45);\n            this.panel3.Name = \"panel3\";\n            this.panel3.Size = new System.Drawing.Size(488, 479);\n            this.panel3.TabIndex = 1;\n            // \n            // flowLayoutPanel1\n            // \n            this.flowLayoutPanel1.AutoScroll = true;\n            this.flowLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill;\n            this.flowLayoutPanel1.Location = new System.Drawing.Point(0, 0);\n            this.flowLayoutPanel1.Name = \"flowLayoutPanel1\";\n            this.flowLayoutPanel1.Size = new System.Drawing.Size(488, 479);\n            this.flowLayoutPanel1.TabIndex = 0;\n            // \n            // panel5\n            // \n            this.panel5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(244)))), ((int)(((byte)(244)))), ((int)(((byte)(244)))));\n            this.panel5.Dock = System.Windows.Forms.DockStyle.Top;\n            this.panel5.Location = new System.Drawing.Point(0, 0);\n            this.panel5.Name = \"panel5\";\n            this.panel5.Size = new System.Drawing.Size(878, 2);\n            this.panel5.TabIndex = 2;\n            // \n            // Form1\n            // \n            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);\n            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;\n            this.BackColor = ColorTranslator.FromHtml(\"#F3F3F3\");\n            this.ClientSize = new System.Drawing.Size(882, 685);\n            this.Controls.Add(this.panel2);\n            this.MaximizeBox = false;\n            this.MaximumSize = new System.Drawing.Size(885, 725);\n            this.MinimumSize = new System.Drawing.Size(885, 725);\n            this.Name = \"Form1\";\n            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;\n            this.Text = \"Cell customization\";\n            this.Load += new System.EventHandler(this.Form1_Load);\n            this.panel4.ResumeLayout(false);\n            this.panel2.ResumeLayout(false);\n            this.panel3.ResumeLayout(false);\n            this.ResumeLayout(false);\n\n        }\n\n        #endregion\n\n        private System.Windows.Forms.Panel panel4;\n        private Syncfusion.WinForms.Input.SfCalendar sfCalendar1;\n        private System.Windows.Forms.Panel panel2;\n        private System.Windows.Forms.Panel panel3;\n        private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel1;\n        private System.Windows.Forms.Panel panel5;\n    }\n}\n\n"
    },
    {
      "target": "src/components/scheduler-cell-customization/scheduler.cs",
      "content": "using Syncfusion.WinForms.Controls;\nusing System;\nusing System.Collections.Generic;\nusing System.Drawing;\nusing System.Runtime.InteropServices;\nusing System.Windows.Forms;\n\nnamespace CellCustomization\n{\n    /// <summary>\n    /// Demonstrates the SfCalendar cell customization: the month cells show a\n    /// marker for every appointment and the year view shows an icon per month.\n    /// </summary>\n    public partial class Form1 : SfForm\n    {\n        #region Variables\n\n        /// <summary>\n        /// Holds the appointments that are shown on the calendar.\n        /// </summary>\n        private List<CellCustomizationDataSource.Appointment> m_Appointment =\n            new List<CellCustomizationDataSource.Appointment>();\n\n        /// <summary>\n        /// The colours that have already been handed out to a time range.\n        /// </summary>\n        private List<string> usedColors = new List<string>();\n\n        #endregion\n\n        #region Constructor\n\n        /// <summary>\n        /// Initializes a new instance of the <see cref=\"Form1\"/> class.\n        /// </summary>\n        public Form1()\n        {\n            InitializeComponent();\n        }\n\n        #endregion\n\n        #region Properties\n\n        /// <summary>\n        /// Gets the appointments that are shown on the calendar.\n        /// </summary>\n        public List<CellCustomizationDataSource.Appointment> Appointment\n        {\n            get { return m_Appointment; }\n        }\n\n        #endregion\n\n        #region Events\n\n        /// <summary>\n        /// Prepares the form and fills the calendar with appointments when it is loaded.\n        /// </summary>\n        private void Form1_Load(object sender, EventArgs e)\n        {\n            this.sfCalendar1.SelectionChanged += SfCalendar1_SelectionChanged;\n            this.sfCalendar1.DrawCell += SfCalendar1_DrawCell1;\n            this.sfCalendar1.HighlightTodayCell = false;\n\n            this.m_Appointment = CellCustomizationDataSource.CreateAppointments();\n\n            this.sfCalendar1.Style.Cell.CellFont = new Font(\"Segoe UI\", this.sfCalendar1.Style.Cell.CellFont.Size + 2);\n            this.sfCalendar1.Style.Cell.TrailingCellFont = new Font(\"Segoe UI\", this.sfCalendar1.Style.Cell.CellFont.Size + 2);\n            this.sfCalendar1.Style.Cell.SelectedCellFont = new Font(\"Segoe UI\", this.sfCalendar1.Style.Cell.CellFont.Size + 2);\n            this.sfCalendar1.SelectedDate = this.Appointment[0].Date;\n\n            SfSkinManager.SetVisualStyle(this, \"Office2019Colorful\");\n        }\n\n        /// <summary>\n        /// Brightens or darkens the supplied colour.\n        /// </summary>\n        public static Color ChangeColorBrightness(Color color, float correctionFactor)\n        {\n            float red = (float)color.R;\n            float green = (float)color.G;\n            float blue = (float)color.B;\n\n            if (correctionFactor < 0)\n            {\n                correctionFactor = 1 + correctionFactor;\n                red *= correctionFactor;\n                green *= correctionFactor;\n                blue *= correctionFactor;\n            }\n            else\n            {\n                red = (255 - red) * correctionFactor + red;\n                green = (255 - green) * correctionFactor + green;\n                blue = (255 - blue) * correctionFactor + blue;\n            }\n\n            return Color.FromArgb(color.A, (int)red, (int)green, (int)blue);\n        }\n\n        /// <summary>\n        /// Draws the customized calendar cells.\n        /// </summary>\n        private void SfCalendar1_DrawCell1(Syncfusion.WinForms.Input.SfCalendar sender, Syncfusion.WinForms.Input.Events.DrawCellEventArgs args)\n        {\n            if (!args.Value.HasValue)\n            {\n                return;\n            }\n\n            if (args.ViewType == Syncfusion.WinForms.Input.Enums.CalendarViewType.Year)\n            {\n                Image image = CellCustomizationDataSource.GetYearIcon(args.Value.Value.Month, args.Value.Value.Year);\n                if (image != null)\n                {\n                    args.Handled = true;\n                    args.Graphics.DrawImage(image, args.CellBounds);\n                }\n\n                return;\n            }\n\n            if (args.ViewType != Syncfusion.WinForms.Input.Enums.CalendarViewType.Month)\n            {\n                return;\n            }\n\n            args.Graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;\n\n            int startPosition = 0;\n            CellCustomizationDataSource.Appointment appointment =\n                CellCustomizationDataSource.FindAppointment(this.Appointment, args.Value.Value.Date);\n\n            if (appointment != null && (args.Value.Value.DayOfWeek != DayOfWeek.Sunday))\n            {\n                args.Handled = true;\n\n                for (int index = 0; index < appointment.Appointments.Count; index++)\n                {\n                    Color markerColor = args.IsTrailingDate\n                        ? ControlPaint.LightLight(appointment.Appointments[index].AppointmentColor)\n                        : appointment.Appointments[index].AppointmentColor;\n\n                    args.Graphics.FillRectangle(\n                        new SolidBrush(markerColor),\n                        new Rectangle(\n                            (args.CellBounds.X + (args.CellBounds.Width - args.CellBounds.Width / 2)) -\n                            (appointment.Appointments.Count * 2) - (appointment.Appointments.Count * 6) - startPosition,\n                            (args.CellBounds.Y + (args.CellBounds.Height - 20)),\n                            12,\n                            12));\n\n                    startPosition -= 18;\n                }\n\n                TextRenderer.DrawText(\n                    args.Graphics,\n                    args.Value.Value.Day.ToString(),\n                    new Font(\"Segoe UI\", this.sfCalendar1.Style.Cell.CellFont.Size),\n                    args.CellBounds,\n                    args.IsTrailingDate ? ControlPaint.LightLight(Color.IndianRed) : Color.IndianRed,\n                    TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter);\n            }\n            else\n            {\n                args.Handled = true;\n\n                if (!args.IsTrailingDate)\n                {\n                    TextRenderer.DrawText(\n                        args.Graphics,\n                        args.Value.Value.Day.ToString(),\n                        new Font(\"Segoe UI\", this.sfCalendar1.Style.Cell.CellFont.Size),\n                        args.CellBounds,\n                        this.sfCalendar1.Style.Cell.CellForeColor,\n                        TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter);\n                }\n                else\n                {\n                    TextRenderer.DrawText(\n                        args.Graphics,\n                        args.Value.Value.Day.ToString(),\n                        new Font(\"Segoe UI\", this.sfCalendar1.Style.Cell.CellFont.Size),\n                        args.CellBounds,\n                        ControlPaint.LightLight(this.sfCalendar1.Style.Cell.TrailingCellForeColor),\n                        TextFormatFlags.VerticalCenter | TextFormatFlags.HorizontalCenter);\n                }\n            }\n        }\n\n        /// <summary>\n        /// Unsubscribes from the calendar events when the form is closed.\n        /// </summary>\n        protected override void OnClosing(System.ComponentModel.CancelEventArgs e)\n        {\n            this.Load -= new EventHandler(Form1_Load);\n            this.sfCalendar1.SelectionChanged -= SfCalendar1_SelectionChanged;\n            this.sfCalendar1.DrawCell -= new Syncfusion.WinForms.Input.Events.DrawCellEventHandler(SfCalendar1_DrawCell1);\n            base.OnClosing(e);\n        }\n\n        /// <summary>\n        /// Lists the appointments of the selected date in the side panel.\n        /// </summary>\n        private void SfCalendar1_SelectionChanged(Syncfusion.WinForms.Input.SfCalendar sender, Syncfusion.WinForms.Input.Events.SelectionChangedEventArgs args)\n        {\n            LockWindowUpdate(this.panel3.Handle);\n            this.flowLayoutPanel1.Controls.Clear();\n\n            if (this.sfCalendar1.SelectedDate == null)\n            {\n                LockWindowUpdate(IntPtr.Zero);\n                return;\n            }\n\n            EventHeaderControl headerControl = new EventHeaderControl();\n            headerControl.EventHeaderLabel.Text = \"Appointments\";\n            this.flowLayoutPanel1.Controls.Add(headerControl);\n\n            SelectedDateControl selectedDateControl = new SelectedDateControl();\n            selectedDateControl.SelectedDateLabel.Text = this.sfCalendar1.SelectedDate.Value.ToString(\"dddd, dd MMMM yyyy\");\n            this.flowLayoutPanel1.Controls.Add(selectedDateControl);\n\n            CellCustomizationDataSource.Appointment appointment =\n                CellCustomizationDataSource.FindAppointment(this.Appointment, this.sfCalendar1.SelectedDate.Value);\n\n            if (appointment != null)\n            {\n                for (int index = 0; index < appointment.Appointments.Count; index++)\n                {\n                    AppointmentControl appointmentControl = new AppointmentControl();\n                    appointmentControl.DescriptionLbl.Text = appointment.Appointments[index].Description;\n                    appointmentControl.TimeLbl.Text = appointment.Appointments[index].Time;\n\n                    if (this.sfCalendar1.SelectedDate.Value.DayOfWeek != DayOfWeek.Sunday)\n                    {\n                        this.flowLayoutPanel1.Controls.Add(appointmentControl);\n                    }\n                }\n            }\n\n            if (this.flowLayoutPanel1.Controls.Count == 2 ||\n                this.sfCalendar1.SelectedDate.Value.DayOfWeek == DayOfWeek.Sunday)\n            {\n                NoAppointmentControl noAppointmentControl = new NoAppointmentControl();\n                noAppointmentControl.NoAppointmentLabel.Text = \"No Appointments\";\n                this.flowLayoutPanel1.Controls.Add(noAppointmentControl);\n            }\n\n            LockWindowUpdate(IntPtr.Zero);\n            this.flowLayoutPanel1.Refresh();\n        }\n\n        #endregion\n\n        #region Native\n\n        /// <summary>\n        /// Locks the window repaint while the side panel is rebuilt.\n        /// </summary>\n        [DllImport(\"user32.dll\")]\n        private static extern long LockWindowUpdate(IntPtr handle);\n\n        #endregion\n    }\n}\n"
    }
  ]
}