The Value property of a date field control (SftDate) holds its value, the Value property of a month calendar control (SftCalendar) its selected date. The property is a VARIANT holding a date, or Null when there is no value: the field is empty, its check box is cleared, or no date is selected in the calendar. The dates are dates of the Gregorian calendar, whatever calendar system the control shows (see Cultures and Calendar Systems).
A field holds a date and a time of day to the millisecond, whatever its format shows. A new field holds the current date and time, unless the DefaultText property defines another value (see below). A calendar holds a date only: the time of day of a value it is given is ignored, and the values it returns are at midnight. A new month calendar control has no selected date until the user or the application selects one.
In .NET, Null is DBNull.Value. An application tests the property with "is DateTime" before it uses the date, and sets DBNull.Value or null to remove the value:
if (sftDate1.Value is DateTime) MessageBox.Show(((DateTime)sftDate1.Value).ToLongDateString()); else MessageBox.Show("No date"); sftDate1.Value = DateTime.Now; sftDate1.AllowEmpty = true; sftDate1.Value = DBNull.Value;
In VB.NET, the test is TypeOf ... Is Date, and DBNull.Value or Nothing removes the value. In C++, the property is a _variant_t whose vt is VT_DATE for a date and VT_NULL when there is none; setting a _variant_t with vt VT_NULL removes the value.
The ValueChanged event occurs whenever the value changes, whether the user or the application changed it. The Text property of a field is its formatted value, or an empty string when it has none; setting it parses a text in the field's culture and sets the value (see Editing).
In range mode, the RangeStart and RangeEnd properties and the SetRange method read and set the range of a field or a calendar, and the value is the first date of the range (see Date Ranges).
The MinDate and MaxDate properties define the earliest and latest value of a field, and the first and last date the user can select in a calendar (MinDate, MaxDate). A field's limits include the time of day; a calendar's limits are dates. The user cannot enter values outside these limits, and setting one causes an error. A value that lies outside new limits is moved to the nearest limit, and the ValueChanged event occurs.
By default, MinDate is January 1, 0100, the earliest date the controls support, and MaxDate December 31, 9999. Within this range, the dates are limited to those the calendar system of the culture supports.
sftDate1.MinDate = DateTime.Today; sftDate1.MaxDate = DateTime.Today.AddYears(1);
A field can be empty in three ways:

| Property | Description |
|---|---|
| ShowCheckBox | A check box is shown in front of the value. While it is cleared (the Checked property is False), the value is shown dimmed and the Value property is Null. The Space key and a click toggle it, the Checked property sets it, and choosing a date in the dropdown or setting a value checks it. While the check box is cleared, the field ignores all other keys. |
| AllowEmpty | The field can be empty. An empty field shows the text defined by the PlaceholderText property in the PlaceholderForeColor color while it does not have the input focus. With free-form editing, the text box shows it as its cue banner in the system's gray, also while it has the input focus. The user empties it with the Delete or Backspace key in each of its parts, with the Clear button or the Clear button of the dropdown calendar, or by deleting the text in a field with free-form editing. |
| ShowClearButton | A Clear button is shown while the field has a value. It empties the field when empty values are allowed, or clears the check box when a check box is shown. |
Setting the Value property to Null requires AllowEmpty or ShowCheckBox; otherwise it causes an error and the field keeps its value.
The DefaultText property sets the value from one of these texts when it is set and each time the control is loaded, so a form whose field has the default text "=Today" shows the current date whenever it opens. A value saved with the form (a value set at design time) takes precedence.
| Text | Value |
|---|---|
| =Today | The current date, at midnight. |
| =Yesterday | The day before the current date, at midnight. |
| =Tomorrow | The day after the current date, at midnight. |
| =Now | The current date and time. |
The texts are not case-sensitive; another text is kept but doesn't change the value. A date outside the limits is moved into them, and in range mode both dates are set. The texts always use the computer's date, not the date defined by the Calendar.TodayDate property. The user can type the same texts in a field with free-form editing (see Editing).