$99 VS $1000+. UI Control for ASP.NET AJAX(contains chart and gridview).
Calendar Controls for WinForms UI Tutorial
Customize dates selection in C# for .NET Windows Forms template projects
Home > WinForms UI Controls > User Manual > Customize Behavior Select Dates in C#

Dates Selection - WinForms Calendar Controls

The Calendar Controls for Windows Forms user interface design offers multiple selection options for the convenience of end users. There are two properties, EnableSelect and EnableMultiSelect, need to be true if enabling the selection of dates. The EnableSelect property is used to enable the date selections and the EnableMultiSelect property is used to enable multiple selections at one time.

Keyboard Date Navigation for WinForms Calendar

  • PageUp, hitting the PageUp key will navigate users to previous view
  • PageDown, hitting the PageDown key will navigate users to next view
  • Up, hitting the Up key will navigate users to the previous week.
  • Down, hitting the Up key will navigate users to the next week.
  • Left, hitting the Up key will navigate users to the previous day.
  • Right, hitting the Up key will navigate users to the next day. If the next day is part of the next month the calendar view changes to next month.

Click Navigation for WinForms Calendar

It is really easy to select a single date by clicking on the date with mouse. When the value of the property, EnableMultiSelect, is true, users could select more than one date by pressing the Ctrl and clicking each date.

C# Code for Selecting Dates in Calendar

  • A single calendar day, assign Calendar SelectedDate a DateTime value.
  • To select multiple dates use the Calendar SelectedDates.Add() method to add DateTime values to the collection.
  • To have more than one date in the SelectedDates collection you should set the Calendar AllowMultipleSelect property to true.
The following C# code snippet shows how to selecting a single calendar day, multiple dates and more dates in the SelectedDates collection.

calendar1.AllowMultipleSelect = true;
calendar1.SelectedDates.Add(new DateTime(2011, 8, 15, 0, 0, 0, 0));
calendar1.SelectedDates.Add(new DateTime(2011, 7, 23, 0, 0, 0, 0));
calendar1.SelectedDates.Add(new DateTime(2011, 6, 30, 0, 0, 0, 0));
You may also use the SelectedDates.AddRange() method to add an array of DateTime values:

calendar1.SelectedDate = new System.DateTime(2011, 10, 25, 0, 0, 0, 0);
calendar1.SelectedDates.AddRange(new DateTime[] { new DateTime(2007, 9, 17, 0, 0, 0, 0) });
UI Controlsfor Windows Forms
.NET WinForms UI Overview.NET WinForms UI Features.NET WinForms UI GuideC# WinForms UI DesignVB.NET WinForms UI Design
WinForms UI Controls