DateTimePicker resets day - winforms

I am using DateTimePicker with Australian date formatting set (dd/mm/yyyy)
The problem is when user enters a day which is outside of the month (mm), control resets that day to "1".
This obviously is a quite confusing obstacle for user - it's not natural to enter the month first and then enter the day [culture-wise]
Is there a way to disable this validation or postpone it till say,when control loses focus?
Thanks!

I've tried and I do not see anyway we can disable this for on micro-validation via the DateTimePicker's properties.
I know your frustration when the current date is "09/11/2009" (dd/MM/yyyy) and a user wants to enter "31/12/2009" via the keyboard from left to right.
Upon htting "31", it'll revert to "1" as Nov has only 30 days. It will show "2" if "32" is entered.
It forces the user to enter the month first followed by the day. I.e. entering in the direction of right, left, far-right.
My suggestion is use a more generic form of format like yyyy-MM-dd which though does not follow your regional/cultural format, still is easily understood by the user (or Aussie friends).

Another option might be to instantiate an edit control and overlay it on top of the date time picker's edit, and use the value to set the date time picker's value. Of course, you'll need to do some validation before doing the setting; and you'll also want to mimic the way the date time picker's edit field allows you to select the date, month and year individually.

Related

How to link DayPicker to existing input element

I'm using react-day-picker DayPicker (not DayPickerInput) and have an existing element I want to use to drive the date popup. I can't figure out how to pre-feed the date from the element to the calendar and highlight the given date. All the other functionality, e.g. capturing the user chosen date and populating the element are working fine. So if my input element has Nov 11, 2019, and I click on it, I want the popup to go to that date and show it as selected. The current behavior is that it shows the current month and date. I've tried to set the selectedDays={this.state.selectedDay}, but that doesn't seem to work. Note that I am new to reactjs, and this could be the gap in my understanding.
Thanks for any suggestions you may have.
Found at least one way to achieve the behavior I was looking for. There is a DayPicker property "initialMonth" that will display the current month. Note that this only needs to be populated only with year and month:
initialMonth = {new Date(selectedDate.getFullYear(), selectedDate.getMonth())}

WPF DatePicker Blackout date entered, prevent old value from being restored

When I use the WPF 4.0 DatePicker with blackout date (or min/max), and the user enters a date that is blacked out by typing it in, the DatePicker reverts back to the original value.
This behavior is not the best for entering dates. If you key in the wrong year and tab out, it reverts back to the old value.
I'd like to be able to handle the error in code instead of just reverting back to the old value.

Edit the date using DateTimePicker

I am able to edit month,date and year by using TAB or Arrow keys(MM-dd-yyyy). I have doubt is this possible to edit total date format at a time (not using tab key or any arrow keys).
No, I don't think this is possible. From Using the DateTimePicker Control
The DateTimePicker operates as a masked edit control for entering date and time values. Each part of the date or time is treated as a separate field within the edit portion of the control. As the user clicks on each field, it is highlighted and they can use the up and down arrow keys to increment or decrement the value of the field. The user can also type values directly into the control, where applicable.

WPF Datepicker scroll through dates in textbox

I would like to scroll using the arrow keys through the day month and year fields in the datepicker textbox.
I am guessing this will be a two step solution:
1- break up month day year into individual fields that the user 'clicks' into.
2- once the user has focus of the either day year or month then they can use arrow keys to scroll up /down.
anyone done this before with wpf?
Found this project has a date time with up / down:
http://wpftoolkit.codeplex.com/

Can I change the input behaviour of a DateTimePicker control?

The default input behaviour of the DateTimePicker when entering a date is like this:
YYYY(Right Arrow)MM(Right Arrow)DD
The user want to enter the date like this:
YYYYMMDD
Is there any simple way of modifying the input behaviour of the DateTimePicker so that is does behave like the user want it to?
TIA
Expanding on PoweRoy's answer. Use a textbox and a datetimepicker. Make the datetimepicker small (just as big as the drop down arrow) and place it next to (or even inside) the textbox. Then you hook the dropdown and closeup events of the datetimepicker to get the value to and from the editbox.
I don't know how you use the DateTimePicker but what about using a simple editbox? (and validate date when a date is entered)
DateTimePicker is mostly used to choose a date without entering any number.

Resources