If you press F4 or double-click a date-time cell when it is in edit mode, a pop-up calendar (or pop-up clock) appears, as shown in the following figures. The calendar control appears if you have the date-time cell set to any format besides TimeOnly format. The clock control appears if you have the format set to TimeOnly. The date you choose from the calendar (or the time you choose from the clock) is placed in the date-time cell. If you want the present date and time, in the calendar control click Today; if you want the present time, in the clock control click Now.

Pop-Up Calendar Control

Pop-Up Clock Control

You can also display the clock control if the DateTimeFormat property is set to UserDefined and the UserDefinedFormat property uses a time setting such as HH:mm.

You can specify normal and abbreviated day names, normal and abbreviated month names, and the text for the buttons at the bottom of the control. Use the SetCalendarText method of the DateTimeCellType class to set these.

Note that the text appears centered on the button. If you set custom text for the buttons, try to limit your text to eight or nine characters in length. The button will display ten characters, but the first and last appear very close to the edges.

When using the controls, you must click the OK or Cancel button to close the control. The Today (or Now) button simply sets the value in the cell to the current date (or time).

For more information on setting the format of the date-time cell, refer to the DateTimeFormat enumeration.

Using the Spread Designer

Select the cell or cells in the work area.

In the property list, in the Misc category, select CellType. From the drop-down list, choose the DateTime cell type. Now expand the CellType property and various properties are available that are specific to this cell type. Set properties such as ShortDayNames and ShortMonthNames to change the calendar text. Set other properties as needed.

Or right-click on the cell or cells and select Cell Type. From the list, select the cell type. In the CellType editor, set the properties you need. Click Apply.

From the File menu choose Apply and Exit to apply your changes to the component and exit Spread Designer.