DateTimePicker has a calendar drop-down button on its right side. Usually it displays a little calendar icon, but if the control is resized to the point where the icon would overlap the text, it changes to a thinner arrow dropdown.
The problem: If the DateTimePicker is below that width when the program is launched, the dropdown icon is very wide and overlaps the text. Resizing the window horizontally corrects the width, and after that it stays corrected.
I would like to know:
- What is causing this.
- How best to fix it.
Here's what it looks like:
On Launch
After Resize
Edit #1:
This display issue only seems to happen on startup. If I add a new control based on user input it displays properly:
Edit #2:
I've further narrowed down what's causing the issue. It only occurs (on my PC, running Windows 8.1) when:
- The DateTimePicker.Format is set to 'Custom'.
- The DateTimePicker's width at startup is set to 109 or wider.
- The right edge of the control is close enough to the formatted date that its icon collapses down to the arrow dropdown.
If I set the control's custom format to "MMMM d, yyyy", I get the issue. This formatting is exactly the same as when DateTimePicker.Format is set to 'Long', but without a custom format the control displays properly.