C1TextBox supports a special editing mode called DateTimeInput mode that makes editing date and time values easier. This mode is enabled when DataType property is set to DateTime and DateTimeInput property is set to True (default). In the DateTimeInput mode, the currently selected date or time field, such as the year, month, date, and so on, is highlighted and edited separately. Formatted fields represented in string form, such as month or day of the week in LongDate format, can be typed as numbers on the keyboard, and their string representation is updated automatically. The UP ARROW/DOWN ARROW keys or mouse wheel can be used to increment/decrement the current field.
Additional properties controlling date-time input are:
Property | Description |
---|---|
MinShortYear | The minimum year that can be entered without leading zeros (when DateTimeInput is set to True). For example, if MinShortYear is set to 300 (default), entering 200 is not allowed (will be ignored), whereas 400 is interpreted as 0400 A.D. Regardless of this property value, entering 0200 will be interpreted as year 0200 A.D. |
CurrentTimeZone | This property is True by default, which means that date-time values are invariant, not adjusted to time zones. If this property is set to False, the Text shown to the user and the underlying stored Value become different. The stored Value belongs to the time zone defined by the GMTOffset property specifying the offset in hours and minutes of the base time zone from Greenwich Mean Time. The Text shown to the user belongs to the local time zone defined by the user computer settings. Displaying values and parsing values entered by the user, C1Input adjusts it to the time zone difference. |
To make editing date-time values even more convenient to the user, you can use the specialized C1DateEdit control. In addition to C1TextBox functionality, it supports a drop-down calendar and up/down buttons (speedbuttons) incrementing/decrementing the currently selected date-time field.