The SftDate.EditStyle property defines how the user enters the value of a field: one part at a time (EditStyleEnum.Segments, the default) or by typing the whole value as text (EditStyleEnum.FreeForm).

With EditStyleEnum.Segments, each part of the value (day, month, year, hours, minutes, seconds, AM/PM, era) is edited separately. The part being edited is highlighted in the SftDate.SegmentHighlightBackColor and SftDate.SegmentHighlightForeColor colors.
When a change creates a date that does not exist, such as February 30, the day is reduced to the last day of the month.
With EditStyleEnum.FreeForm, the user types the value as text. The text is parsed when the user presses Enter, leaves the field or opens the dropdown. A text that cannot be parsed is rejected with a beep and the previous value is kept; an empty text empties the field when the SftDate.AllowEmpty or SftDate.ShowCheckBox property is set. The Up and Down keys accept the text and change the value by one day, or by one minute in a field showing only a time.
A text is parsed in the following order:
Parts the format does not show are kept from the current value; a time typed in a date and time field keeps the date. In range mode, the first and the last date are separated by the SftDate.RangeSeparator text.
The SftDate.TextParsing event occurs before a text typed in a free-form field or pasted into a field is parsed. The event handler sets TextParsingEventArgs.Handled to indicate that it parsed the text, and TextParsingEventArgs.Value to the value the text represents (or null if the text is invalid). This example accepts "+7" or "-3" as a number of days from the current value:
C#
private void sftDate1_TextParsing(object sender, TextParsingEventArgs e) { int days; if ((e.Text.StartsWith("+") || e.Text.StartsWith("-")) && int.TryParse(e.Text, out days)) { e.Value = e.CurrentValue.AddDays(days); e.Handled = true; } }
VB
Private Sub SftDate1_TextParsing(sender As Object, e As TextParsingEventArgs) Handles SftDate1.TextParsing Dim days As Integer If (e.Text.StartsWith("+") OrElse e.Text.StartsWith("-")) AndAlso Integer.TryParse(e.Text, days) Then e.Value = e.CurrentValue.AddDays(days) e.Handled = True End If End Sub
The value is then checked like any value the user enters (see Validation).