[[Property:title|Date Time Picker]]
[[Property:weight|1]]
[[Property:uuid|9f94f4f3-3a6e-1fe7-f9c0-d9411913ce25]]
<div> 
[[Image:date-time-picker|Hello world form]]  
</div>
<br/>
<br/>


==Compiling==

To compile the example:   
# Launch EiffelStudio.
# Click '''Add project'''
# Browse to ''$ISE_EIFFEL\examples\dotnet\winforms\control_reference\date_time_picker_ctrl\''
# Choose ''date_time_picker_ctrl.ecf''
# Choose the location where the project will be compiled, by default the same directory containing the configuration file.
# Click '''Open'''.


==Running==

After launching the application, you will see a window displayed with a similar appearance to the one above. On the left side of the main window a date is displayed in a <span><eiffel>COMBO_BOX</eiffel></span>. Clicking on this <span><eiffel>COMBO_BOX</eiffel></span> and a <span><eiffel>CALENDAR</eiffel></span> control will appear showing the same date as in the <span><eiffel>COMBO_BOX</eiffel></span>. On the right side of the main window are the controls for selecting the format of the displayed date and the style of the <span><eiffel>CALENDAR</eiffel></span> control. 

Clicking on the "Change font" button and a change font dialog box will appear.  

[[Image:change-font-dialog|change font dialog box]] . 

Clicking on the "Change color" button and a dialog box will appear. This dialog box will permit you to customize the color appearance of the calendar.  

[[Image:dotnet-samples--date-time-picker-change-color-dlg|color dialog box]] . 



==Under the Hood==

This application uses several different controls, but tend to show how to parameter the <span><eiffel>CALENDAR</eiffel></span> control using the <span><eiffel>FONT_DIALOG</eiffel></span> and <span><eiffel>COLOR_DIALOG</eiffel></span>. 

When one of the buttons "Change font" or "Change color" is pressed, an event is launched and open the corresponding dialog box. 

When the entry in the <span><eiffel>COMBO_BOX</eiffel></span> format changes, an event is launched and modify the format of the displayed date. 

This sample uses the following classes:
*  <span><eiffel>CALENDAR</eiffel></span> 
*  <span><eiffel>COMBO_BOX</eiffel></span> 
*  <span><eiffel>BUTTON</eiffel></span> 
*  <span><eiffel>LABEL</eiffel></span> 
*  <span><eiffel>GROUP_BOX</eiffel></span> 
*  <span><eiffel>CHECK_BOX</eiffel></span> 

==Notes==

This sample is translated from the example located in the QuickStart\winforms\samples\controlReference\dateTimePicker sub-directory of the .NET Framework SDK samples directory of Microsoft Visual Studio .NET. 

