You’ll need to brace yourself for disasters, too, including pirates who’ll ransack your turf and meteor impacts that can take out important supply depots, which can mean the difference between life and death. You’ll start from the ground up in Another Brick In The Mall, optimally laying out every road with designated parking spots for customers and deliveries while building up each wall, tile floor, door, and more before you jump into the goods and services markets.
Build your own city games.
The following illustration shows how a date picker looks when it is selected in design mode.
Controls can be bound or unbound. When a control is bound, it is connected to a field or group in the data source so that data entered into the control is saved in the underlying form (.xml) file. When a control is unbound, it is not connected to a field or group, and data entered into the control is not saved. When you select or move your pointer over a control, text and a binding icon appear in the upper-right corner of the control. The text indicates the group or field to which the control is bound in the data source. The icon indicates whether the control is correctly bound to that group or field. When the binding is correct, a green icon appears. If there's something wrong with the binding, you'll see a blue or red icon instead.
The data source for the form template consists of fields and groups that appear in a hierarchical view in the Data Source task pane. Date picker controls are always bound to fields. In the following example, the Departure date date picker on the form template is bound to the departureDate field in the Data Source task pane.
Insert a date picker on a new, blank form template
When you design a new, blank form template, the Automatically create data source check box in the Controls task pane is selected by default. This enables InfoPath to automatically create fields and groups in the data source as you add controls to the form template. These fields and groups are represented by folder and file icons in the Data Source task pane.
On the form template, place the cursor where you want to insert the control.
If the Controls task pane is not visible, click More Controls on the Insert menu, or press ALT+I, C.
Under Insert controls, click Date Picker.
To add a label to the control, type text above or to the left of the control, followed by a colon (:).
To specify the way that the date is displayed on the form, double-click the date picker that was inserted on the form template.
Click the Data tab, and then click Format.
In the Display the date like this list, in the Date format dialog box, click the display format that you want.
Note: You can change the display format of the date only if the data type is text, date, or date and time.
Insert a date picker on a form template that is based on an existing data source
If you base the design of your form template on an existing Extensible Markup Language (XML) file, database, or Web service, InfoPath derives the fields and groups in the Data Source task pane from that existing data source. In this scenario, you can add a date picker either by dragging a date picker field from the Data Source task pane onto the form template or by inserting the date picker by using the Controls task pane, as described in the following procedure:
On the form template, place the cursor where you want to insert the control.
If the Controls task pane is not visible, click More Controls on the Insert menu, or press ALT+I, C.
Under Insert controls, click Date Picker.
In the Date Picker Binding dialog box, select the field in which you want to store the date picker data, and then click OK.
InfoPath uses the name of the field or group as the control's label. If necessary, change the label text.
To specify the way that the date is displayed on the form, double-click the date picker that was inserted on the form template.
On the Data tab, click Format.
In the Display the date like this list box, in the Date format dialog box, click the display format that you want.
Note: You can change the display format of the date only if the data type is text, date, or date and time.
Tip: You can also use the Data Source task pane to insert controls. In the Data Source task pane, right-click the field that you want to bind the date picker to, and then click Date Picker on the shortcut menu.
Display the current date in a date picker
To automatically insert the current date on a form when users open it, you can use the today function with a date picker control.
Insert a date picker on the form template.
Double-click the date picker that you inserted on the form template.
Click the Data tab.
Under Default Value, click Insert Formula .
In the Insert Formula dialog box, click Insert Function.
In the Categories list in the Insert Function dialog box, click Date and Time.
In the Functions list, click today, and then click OK twice to return to the Date Picker Properties dialog box.
Notice that today() appears in the Value box.
Under Default Value, clear the Update this value when the result of the formula is recalculated check box.
Note: If you clear this check box, the date isn't updated automatically each time a user opens a form based on this form template. This is ideal in situations where you want users to see the date when the form was created. You can leave the check box selected in situations where you have a Last updated on or Last opened on field, where you want the date to change every time the form is opened.
Click OK to return to the form template.
To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B.
Verify that the date that appears in the date picker looks the way that you want it to. If it doesn't, you can change how the date or time is displayed by clicking the Format button in the Date Picker Properties dialog box.
Display the current date and time in a date picker
To automatically insert the current date and time on a form when users open it, you can use the now function with a date picker control.
Insert a date picker on the form template.
Double-click the date picker that you inserted on the form template.
Click the Data tab.
In the Data type box, click Date and Time (dateTime).
Click Format.
In the Date and Time Format dialog box, in the Display the time like this list, click the option that you want, and then click OK.
In the Date Picker Properties dialog box, under Default Value, click Insert Formula .
In the Insert Formula dialog box, click Insert Function.
In the Categories list in the Insert Function dialog box, click Date and Time.
In the Functions list, click now, and then click OK twice to return to the Date Picker Properties dialog box.
Notice that now() appears in the Value box.
Under Default Value, clear the Update this value when the result of the formula is recalculated check box.
Note: If you clear this check box, the date isn't updated automatically each time a user opens a form based on this form template. This is ideal in situations where you want users to see the date when the form was created. You can leave the check box selected in situations where you have a Last updated on or Last opened on field, where you want the date to change every time the form is opened.
Click OK to return to the form template.
To test your changes, click Preview on the Standard toolbar, or press CTRL+SHIFT+B.
Verify that the date that appears in the date picker looks the way that you want it to. If it doesn't, you can change how the date or time is displayed by clicking the Format button in the Date Picker Properties dialog box.
Layout tips
Use the following tips to help you refine the appearance, size, and other aspects of a date picker:
To change the size of several date pickers at once, select the date pickers whose size you want to change, on the Format menu, click Properties, and then on the Size tab, make the necessary adjustments.
To change the border or color of a date picker, select the date picker, on the Format menu, click Borders and Shading, and then make the necessary adjustments.
To customize the text that appears in a date picker, use the Font and Font Size boxes on the Formatting toolbar. To change the font and font size for all of the date pickers on your form template at once, right-click the date picker that contains the formatting that you want, and then click Apply Font to All Date Picker Controls on the shortcut menu.
To see what your date picker will look like with actual text in it, click Sample Data on the View menu. This helps you get a sense of what the form will look like when users fill it out.
On occasion, the text inside a date picker and the label to the left of the date picker may appear to be slightly out of alignment. To quickly realign them, double-click the date picker, click Align on the Size tab, and then click Apply. If the label and date picker are in different cells in a layout table, right-click the cell that contains the label, click Table Properties on the shortcut menu, and then click Center under Vertical alignment on the Cell tab.
To change the way that the date is displayed, double-click the date picker, click the Data tab, and then click the Format button. Choose a display format in the Date Format dialog box.
-->This section contains information about the API elements used with date and time picker controls.
Overviews
Topic | Contents |
---|
About Date and Time Picker Controls | A date and time picker (DTP) control provides a simple and intuitive interface through which to exchange date and time information with a user.
|
Using Date and Time Picker Controls | This section provides information and sample code for implementing date and time picker controls.
|
Macros
Topic | Contents |
---|
DateTime_CloseMonthCal | Closes the date and time picker (DTP) control. Use this macro or send the DTM_CLOSEMONTHCAL message explicitly.
|
DateTime_GetDateTimePickerInfo | Gets information for a specified date and time picker (DTP) control.
|
DateTime_GetIdealSize | Gets the size needed to display the control without clipping. Use this macro or send the DTM_GETIDEALSIZE message explicitly.
|
DateTime_GetMonthCal | Gets the handle to a date and time picker's (DTP) child month calendar control. You can use this macro or send the DTM_GETMONTHCAL message explicitly.
|
DateTime_GetMonthCalColor | Gets the color for a given portion of the month calendar within a date and time picker (DTP) control. You can use this macro or send the DTM_GETMCCOLOR message explicitly.
|
DateTime_GetMonthCalFont | Gets the font that the date and time picker (DTP) control's child month calendar control is currently using. You can use this macro or send the DTM_GETMCFONT message explicitly.
|
DateTime_GetMonthCalStyle | Gets the style of a specified DTP control. Use this macro or send the DTM_GETMCSTYLE message explicitly.
|
DateTime_GetRange | Gets the current minimum and maximum allowable system times for a date and time picker (DTP) control. You can use this macro, or send the DTM_GETRANGE message explicitly.
|
DateTime_GetSystemtime | Gets the currently selected time from a date and time picker (DTP) control and places it in a specified SYSTEMTIME structure. You can use this macro, or send the DTM_GETSYSTEMTIME message explicitly.
|
DateTime_SetFormat | Sets the display of a date and time picker (DTP) control based on a given format string. You can use this macro or send the DTM_SETFORMAT message explicitly.
|
DateTime_SetMonthCalColor | Sets the color for a given portion of the month calendar within a date and time picker (DTP) control. You can use this macro or send the DTM_SETMCCOLOR message explicitly.
|
DateTime_SetMonthCalFont | Sets the font to be used by the date and time picker (DTP) control's child month calendar control. You can use this macro or explicitly send the DTM_SETMCFONT message.
|
DateTime_SetMonthCalStyle | Sets the style for a specified DTP control. Use this macro or send the DTM_SETMCSTYLE message explicitly.
|
DateTime_SetRange | Sets the minimum and maximum allowable system times for a date and time picker (DTP) control. You can use this macro or send the DTM_SETRANGE message explicitly.
|
DateTime_SetSystemtime | Sets a date and time picker (DTP) control to a given date and time. You can use this macro or send the DTM_SETSYSTEMTIME message explicitly.
|
Messages
Microsoft Date And Time Picker Excel 64 Bit
Topic | Contents |
---|
DTM_CLOSEMONTHCAL | Closes a DTP control. Send this message explicitly or by using the DateTime_CloseMonthCal macro.
|
DTM_GETDATETIMEPICKERINFO | Gets information on a date and time picker (DTP) control.
|
DTM_GETIDEALSIZE | Gets the size needed to display the control without clipping. Send this message explicitly or by using the DateTime_GetIdealSize macro.
|
DTM_GETMCCOLOR | Gets the color for a given portion of the month calendar within a date and time picker (DTP) control. You can send this message explicitly or use the DateTime_GetMonthCalColor macro.
|
DTM_GETMCFONT | Gets the font that the date and time picker (DTP) control's child month calendar control is currently using. You can send this message explicitly or use the DateTime_GetMonthCalFont macro.
|
DTM_GETMCSTYLE | Gets the style of a DTP control. Send this message explicitly or by using the DateTime_GetMonthCalStyle macro.
|
DTM_GETMONTHCAL | Gets the handle to a date and time picker's (DTP) child month calendar control. You can send this message explicitly or use the DateTime_GetMonthCal macro.
|
DTM_GETRANGE | Gets the current minimum and maximum allowable system times for a date and time picker (DTP) control. You can send this message explicitly or use the DateTime_GetRange macro.
|
DTM_GETSYSTEMTIME | Gets the currently selected time from a date and time picker (DTP) control and places it in a specified SYSTEMTIME structure. You can send this message explicitly or use the DateTime_GetSystemtime macro.
|
DTM_SETFORMAT | Sets the display of a date and time picker (DTP) control based on a given format string. You can send this message explicitly or use the DateTime_SetFormat macro.
|
DTM_SETMCCOLOR | Sets the color for a given portion of the month calendar within a date and time picker (DTP) control. You can send this message explicitly or use the DateTime_SetMonthCalColor macro.
|
DTM_SETMCFONT | Sets the font to be used by the date and time picker (DTP) control's child month calendar control. You can send this message explicitly or use the DateTime_SetMonthCalFont macro.
|
DTM_SETMCSTYLE | Sets the style of a DTP control. Send this message explicitly or by using the DateTime_SetMonthCalStyle macro.
|
DTM_SETRANGE | Sets the minimum and maximum allowable system times for a date and time picker (DTP) control. You can send this message explicitly or use the DateTime_SetRange macro.
|
DTM_SETSYSTEMTIME | Sets the time in a date and time picker (DTP) control. You can send this message explicitly or use the DateTime_SetSystemtime macro.
|
Notifications
Topic | Contents |
---|
DTN_CLOSEUP | Sent by a date and time picker (DTP) control when the user closes the drop-down month calendar. The month calendar is closed when the user chooses a date from the month calendar or clicks the drop-down arrow while the calendar is open.
|
DTN_DATETIMECHANGE | Sent by a date and time picker (DTP) control whenever a change occurs. This notification code is sent in the form of a WM_NOTIFY message.
|
DTN_DROPDOWN | Sent by a date and time picker (DTP) control when the user activates the drop-down month calendar.
|
DTN_FORMAT | Sent by a date and time picker (DTP) control to request text to be displayed in a callback field. This notification code is sent in the form of a WM_NOTIFY message.
|
DTN_FORMATQUERY | Sent by a date and time picker (DTP) control to retrieve the maximum allowable size of the string that will be displayed in a callback field. This notification code is sent in the form of a WM_NOTIFY message.
|
DTN_USERSTRING | Sent by a date and time picker (DTP) control when a user finishes editing a string in the control. This notification code is only sent by DTP controls that are set to the DTS_APPCANPARSE style. This message is sent in the form of a WM_NOTIFY message.
|
DTN_WMKEYDOWN | Sent by a date and time picker (DTP) control when the user types in a callback field. This message is sent in the form of a WM_NOTIFY message.
|
NM_KILLFOCUS (date time) | Notifies a date and time picker control's parent window that the control has lost the input focus. NM_KILLFOCUS (date time) is sent in the form of a WM_NOTIFY message.
|
NM_SETFOCUS (date time) | Notifies a date and time picker control's parent window that the control has received the input focus. NM_SETFOCUS (date time) is sent in the form of a WM_NOTIFY message.
|
Structures
Topic | Contents |
---|
DATETIMEPICKERINFO | Contains information about a DTP control.
|
NMDATETIMECHANGE | Contains information about a change that has taken place in a date and time picker (DTP) control. This structure is used with the DTN_DATETIMECHANGE notification code.
|
NMDATETIMEFORMAT | Contains information about a portion of the format string that defines a callback field within a date and time picker (DTP) control. It carries the substring that defines the callback field and contains a buffer to receive the string that will be displayed in the callback field. This structure is used with the DTN_FORMAT notification code.
|
NMDATETIMEFORMATQUERY | Contains information about a date and time picker (DTP) control callback field. It contains a substring (taken from the control's format string) that defines a callback field. The structure receives the maximum allowable size of the text that will be displayed in the callback field. This structure is used with the DTN_FORMATQUERY notification code.
|
NMDATETIMESTRING | Contains information specific to an edit operation that has taken place in a date and time picker (DTP) control. This message is used with the DTN_USERSTRING notification code.
|
NMDATETIMEWMKEYDOWN | Carries information used to describe and handle a DTN_WMKEYDOWN notification code.
|
Constants
Microsoft Date And Time Picker Control 2016
Topic | Contents |
---|
Date and Time Picker Control Styles | The window styles listed here are specific to date and time picker controls.
|