WinForms - DateTimePicker default month selection behavior for Server 2003 vs Server 2008?
Posted
by Mike Loux
on Stack Overflow
See other posts from Stack Overflow
or by Mike Loux
Published on 2010-05-21T18:00:33Z
Indexed on
2010/05/21
19:00 UTC
Read the original article
Hit count: 274
Good Afternoon!
Has anybody else noticed a change in the default behavior of the "next" and "previous" month arrows in the standard WinForms DateTimePicker control? I have users running on both Windows Server 2003 and Windows Server 2008 R2, and they are reporting that on 2008 (and Vista/Win7), clicking the right or left arrows on the drop-down Calendar now selects the first day of the month rather than retaining the same day like 2003 (and XP) does.
I have checked this out (I have a Win7 machine) and I have confirmed this behavior. I would prefer that the behavior remain consistent whenever possible. Does anybody know what causes this and if there is a way to get around this? Is there a way to trap the arrow-click event and force the resulting date to retain the original day rather than be reset to the first of the month?
I thought about seeing if there was a way to hit-test the control on a MouseUp event and determine if the arrow buttons were clicked, and then override the month value being set, but I'm not sure if that is even possible. Can anybody provide some wisdom or insight? Thanks!
© Stack Overflow or respective owner