A Bug about System. Windows. Forms. DateTimePicker, system. windows. forms
I received a feedback from the customer today, saying that their system could not query the bill for July. The reason is that they could not select July, and they could not select July ???, Start vs immediately and run the system. It should be the last year's system, and the test data was last year. The data for March was queried. Everything is OK.
Let the customer remotely and show me the operation. I don't believe it. It's true that a remote user can select and input in August and August, but in August, either manually input or selected input is a failure. Disconnected from the remote local device and failed to input.
After a long morning of hard work, I just couldn't find any problems. Why? Du Niang, let's see if July is really haunted, 29 days? Not 28 days? Have you gone through or have you gone crazy? Good is 29 days. Well, it is estimated that Microsoft did not expect that the 28-day Truth of July was broken.
I use. Net4.0, And the DateTimePicker configuration is customized. For example, yyyy, MM, and ShowUpDown = true.
Then I tried to set the format to yyyy, MM, dd, and found that there was no problem with the input time in January,
Set ShowUpDown to false, and the input in February is OK,
Set ShowUpDown to true and the format to yyyy-MM. The input and selection pages in February are correct.
It seems that only when ShowUpDown is set to false and the format is set to yyyy, MM, may not be selected in February.
The solution is to set the custom display to yyyy, MM, dd, And Then shorten the control so that the customer can only see the year and month.
Do you know there are other solutions? Tell me what you want to know.