PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Andrew Lindsay on December 19, 2009, 06:39:00 PM

Title: DateTimePicker Control Take 2
Post by: Andrew Lindsay on December 19, 2009, 06:39:00 PM
OK,

A second 'issue' with the DateTimePicker control.

When I use a format on hh:mm:ss, I can not get it to show 24 hour time, instead, when I toggle up and down on the hours sector (i.e. use the up and down arrows to cycle up or down, it just goes to 12, and not 13, 14 15 ... 23, 0 , 1, 2, 3 etc.

How do I get 24 hour time to be displayed?

Regards

Andrew
Title: Re: DateTimePicker Control Take 2
Post by: Paul Squires on December 19, 2009, 07:54:27 PM
The format string is all explained at this link: http://msdn.microsoft.com/en-us/library/bb761726(VS.85).aspx

In your WM_CREATE for the form, set the date format to use 24-hour.


Function FORM1_WM_CREATE ( _
                         hWndForm As Dword, _      ' handle of Form
                         ByVal UserData As Long _  ' optional user defined Long value
                         ) As Long

    Local hWndControl As Dword
   
    hWndControl = HWND_FORM1_DATETIMEPICKER1
   
    DateTime_SetFormat hWndControl, "HH-mm-ss"

...etc...




Title: Re: DateTimePicker Control Take 2
Post by: Andrew Lindsay on December 20, 2009, 08:05:54 AM
Cheers Paul,

Much apreciated.

Regards

Andrew