The DateTimePicker Value Editor

The following parameters are available to set up value editor using binding string:

Name
of the parameter
Type Description Mandatory
CHECKBOX Logical Availability for editing. None
SPIN Logical Availability of arrows to increase or decrease date component values. None
DROPCALENDAR Logical Date selection from drop-down calendar. None
MINVAL Date Minimum available value. None
MAXVAL Date The maximum available value. None
VALUE Date The default value (NOW is the current time, TODAY is the current day). None
SET_FOCUS_ON_CHECK_BOX Logical Attribute of focus position on the checkbox on starting the editor. None
SHOWTIME Logical Attribute of time component showing. None

Logical values are set as a character string of the ON/OFF or the True/False type.

Features of Application

None

Binding String

UI="DateTimePicker" VALUE="NOW" MINVAL="01/01/1900 00:00:00" MAXVAL="01/01/2999 23:59:00" DROPCALENDAR="ON" SPIN="OFF"

Example

Executing the example requires a form with the button named Button1 on it, the TabSheetBox component and the UiTabSheet component named UiTabSheet1, which is the data source for TabSheetBox.

Class TestForm: Form
    Button1: Button;
    UiTabSheet1: UiTabSheet;
    TabSheetBox1: TabSheetBox;

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        BM: IBindingManager;
        DateTimePickerBinding: IBindingDateTimePicker;
        DTValue: DateTime;
    Begin
        BM := New BindingManager.Create;
        DateTimePickerBinding := BM.CreateByUi("DateTimePicker"As IBindingDateTimePicker;
        DateTimePickerBinding.CheckBox := True;
        DateTimePickerBinding.CheckBoxFocus := True;
        DateTimePickerBinding.DropCalendar := True;
        DateTimePickerBinding.Spin := True;
        DateTimePickerBinding.Time := True;
        DTValue := DateTime.Now;
        DateTimePickerBinding.MinValue := DateTime.AddYears(DTValue, -5);
        DateTimePickerBinding.MaxValue := DateTime.AddYears(DTValue, 5);
        DateTimePickerBinding.Value := DTValue;
        UiTabSheet1.TabSheet.Cell(00).Style.Binding := DateTimePickerBinding.AsString;
    End Sub Button1OnClick;

End Class TestForm;

Clicking the button sets the value editor for the A0 table cell. On editing the cell, the date and time editor with arrows to increase or decrease values of component values and the button to call the drop-down calendar - current date and time are displayed. The limit of available values is five years from current date.

Back