This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Is it possible set the TimePicker to use a 24 hour clock in the format 00:00 (e.g no AM/PM) and to have preset values in 15 minute intervals. |
|
|
|
|
|
Also, how about a new feature to let you set a min and max time? |
|
|
Hello David I have now added a TimeDisplayMode property to the TimePicker. Setting this to TimeDisplayMode.TwentyFourHourTime will display time in the format you described. The TimePicker has an ItemsSource property which can be used to set the contents of the drop down part of the control. This will let you set the suggestion times to be 15 minutes apart. You could use some code like the following to achieve this:
IList<TimeOfDay> times = new List<TimeOfDay>(); I have now also added MinTime and MaxTime properties. To get these changes, simply download the nightly build from tomorrow the 3rd of July. Regards |
|
|
Thank you. I will test this after the weekend and let you know how I get on |
|
|
Jason, 24 hour time format - perfect. Example for populating ItemsSource - Great. Max/Min Times - not sure how you were expecting this to work: - is it possible that the properties could be changed to support string conversion so that I can set the values in the designer using a string? - I was thinking that this could work by when MinTime, MaxTime and Interval were set, the items source could be pre-populated (maybe with another property of "AutoPopulateItemsSource" - see points below about value entry Value Entry Questions/Suggestions - to aid manual entry, could a mask be applied so that a user can just click in the control and type the numbers (i.e. don't have to enter the ":" - Could there be a new property that restricts so that you can only select from one of the list values and not allow manual entry?
Thanks, David |
|
|
Hello David The MinTime and MaxTime properties can now be set using strings in the designer. The format of these strings is simply the hour followed by a ':' followed by the minute. The hour and minute can either be 1 or 2 digits, and it must be in 24 hour time. The items source will now be automatically populated once the control is loaded based on the MinTime, MaxTime and a new TimeSuggestionInterval property. This property is of type 'TimeSpan' and so setting it to be 15 minute intervals can be done with the string "00:15:00". There is now a property called IsMaskEnabled which will use a mask as you described when it is set to true. The new IsReadOnly property can be set to true in order to only allow the user to select from the suggestion list. These new features will be available through the nightly builds from tomorrow the 7th of July. Regards |
|
|
Jason, Some feedback below.
Thanks for the changes so far. It would be great if these few things could be picked up also.
David
|
|
|
Hello David Thanks for pointing these out. I have fixed all these issues and they will be available through the nightly builds from tomorrow the 9th of July. The property grid will now format the TimeOfDay string without including the spaces. Regards |
|
|
All working perfectly now...thanks again |
|