WP7 TimePicker choose time in 24h format

橙三吉。 提交于 2019-12-11 01:09:17

问题


Is there a way to get WP7's TimePicker to allow the user to select the time in 24 hour format? If I set TimePicker.ValueStringFormat to "{0:HH:mm:ss}" it displays in 24h format, but when I click it the input time is still 12h format (with AM/PM). Can TimePicker be configured to scroll 0-23 instead of 1-12 with AM/PM?


回答1:


Here you can find a link that can help: however I notice that now the timePicker handle the 12-24 hours conversion authomatically depending on the phone date-time setting!




回答2:


Some possibilities:

  • use custom time picker control, eg. this one

  • create you own page implementing IDateTimePickerPage interface and point to it in PickerPageUri property of TimePicker control (more info)

I know it should be done easier on standard TimePicker control, but it isn't, so you have to deal with it on your own.



来源:https://stackoverflow.com/questions/9335875/wp7-timepicker-choose-time-in-24h-format

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!