DateTimePicker Format changes from Time to Short Date

I have a number of DateTimePicker controls, some set to dates, some set to a
format of Time. The controls are all embedded in dialogs. I created the
controls by dragging the DateTime picker from the Toolbox and then set the
Format property appropriately.

I have noticed that the Time format will reset spontaneously to
Short Date.

Is there a known problem with the format for the DateTimePicker or is there
anything I can do to keep the format the same

Chanakya




Answer this question

DateTimePicker Format changes from Time to Short Date

  • Johnnie_RSA

    I've had the same problem each time I edit the dialog that uses such a time control in the Resource Editor in Visual Studio .Net 2003. When it's correctly functioning as a time control the item is

        CONTROL         "DateTimePicker1",IDC_START_TIME,"SysDateTimePick32",
                        DTS_RIGHTALIGN | DTS_UPDOWN | WS_TABSTOP | 0x8,253,95,61,
                        12

    After the Resource Editor is done, it becomes:

        CONTROL         "DateTimePicker1",IDC_START_TIME,"SysDateTimePick32",
                        DTS_RIGHTALIGN | DTS_UPDOWN | WS_TABSTOP,253,95,61,
                        12

    Notice that the " | 0x08" gets removed, which is of course the critical flag that tells the date/time control to display the time. It's not even documented in the appropriate header files. So I have to open my RC file in text mode and put it back.

    Rude, isn't it I've taken to editing my RC files in text mode most of the time anyway because I initially cut and paste between my English resources to the other languages I support, and then later paste in the translations.

    If you find a bug fix for this I'd love to know!!

  • murphy.m.j

    I verified that this was fixed in VS2005.

    Thanks,



  • Takashi kawasaki

    Do you mean at runtime, or do you mean in the form designer

  • DateTimePicker Format changes from Time to Short Date