An object of the DateFormField class represents a date field on a form. It can be initially empty and it can have a horizontal extension, when it is empty. When a date field is clicked or entered through the keyboard's arrow keys a date control is shown where the user can select a date. When the date field is clicked again or the Escape key is pressed the date control is removed and the user can insert or change the date with the keyboard. The date is formatted depending on the culture used for the text of the date field. When a date field is inserted at a position without a set culture, a TextControl uses the system language to select a culture. Supported formats for a certain language can be obtained through the DateFormField.SupportedDateFormats property and can be set with the DateFormField.DateFormat property. When the DateFormat property is an empty string, which is the default, the culture's default format is used. A user can also insert or change a date with the keyboard, then the TextControl tries to parse the inserted date depending on the specified format and culture and automatically formats the date. When parsing is not possible the previous date is restored.

Syntax

public class DateFormField : FormField
Public Class DateFormField
  Inherits FormField

Introduced: X18.

Constructors

Constructor Description
DateFormField Initializes a new instance of the DateFormField class.

Methods

Method Description
FormFieldDialog Opens a dialog box to alter the formatting attributes of the form field.
(Inherited from FormField)

Properties

Property Description
Date Gets or sets the DateFormField's date.
DateFormat Gets or sets the date's format.
EmptyWidth Gets or sets the horizontal extension, in twips, of the DateFormField, when a date is not set.
Enabled Gets or set a value indicating whether the form field is enabled.
(Inherited from FormField)
IsDateControlVisible Gets or sets a value indicating wheather a date control is shown below the DateFormField so that the user can select a date.
SupportedDateFormats Gets an array of format picture strings which can be used to format the date.