PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: DateTimePicker Control Take 2  (Read 505 times)

Andrew Lindsay

  • Junior Member
  • **
  • Posts: 76
DateTimePicker Control Take 2
« on: December 19, 2009, 06:09: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
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8781
  • Windows 10
    • PlanetSquires Software
Re: DateTimePicker Control Take 2
« Reply #1 on: December 19, 2009, 07:24: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.

Code: [Select]
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...



Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Andrew Lindsay

  • Junior Member
  • **
  • Posts: 76
Re: DateTimePicker Control Take 2
« Reply #2 on: December 20, 2009, 07:35:54 AM »

Cheers Paul,
 
Much apreciated.
 
Regards
 
Andrew
Logged