简体   繁体   中英

How to set Format for DateTimePicker in WPF

In my application I'm using the DateTimePicker control from the Xceed Wpf toolkit.

I would like to set the format so that only the hours and minutes can be edited, I want to remove the calendar. since I'm using DateTimePicker to establish how long a process takes. Like this 3d print, it took 20h 40m and save it in my database.

enter image description here only this part

To set the format of the Xceed DateTimePicker control to only show hours and minutes, you can set the Format property to "HH:mm". This will display the time in hours and minutes, and only the time portion can be edited.

Example:

<xctk:DateTimePicker Format="HH:mm" />

This will format the control to only show and allow editing of the hour and minute values.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM