Results 1 to 5 of 5

Thread: Help me fix this control to show AM/PM time, not 24 hour time

  1. #1

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    38

    Help me fix this control to show AM/PM time, not 24 hour time

    I have the c++ source code for a dayview control that displays 24 hour time on the control; 01, 02, 13, 14, (like military hours). I would like to change the display time to show 12 hour AM and PM time.

    Can anyone help with finding where the code is that sets up the 24 hour display time, and then how to change this to show 12 hour am, pm time?

    The original develper seems to have abandoned the project.

    I've attached the c++ source, and a vb sample program.

    One more issue in the vb sample app. The scroll down doesn't work. When you click on the down arrow, the calendar display just flickers some, and the times don't move.

    Any help is greatly appreciated with either of these issues.

    Thanks,
    Attached Files Attached Files
    Chris

  2. #2
    Fanatic Member cpradio's Avatar
    Join Date
    Apr 2002
    Posts
    616
    why not just grab the hour if it is over 12 subtrack 12 from the hour number and set the daytime to "PM" else set the daytime for "AM"

    -Matt

  3. #3

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    38
    I program with VB, not C.
    But I looked around the C source code and couldn't find where the functions or routines are located for setuping up the time and hours.

    Do you see where functions are and how it is done? If so, please let me know.

    Thanks,
    Chris

  4. #4

    Thread Starter
    Member
    Join Date
    Oct 2000
    Posts
    38
    I say 12:30 am, and 11:30 pm.
    I can succesfully compile the dll by doing a batch build with release mindependency. I'm not familiar with C, so I've had to play around with compiling to get it to work. All the source files should be in the original attached zip file.
    I checked the new am pm code you posted, but instead of hours displayed, I get am or pm where the hours should be, but no hours. I attached a small image capture of what it looks like.

    Any ideas on what to change in the code to get the hours to display along with am and pm?

    Thanks for your help,
    Attached Images Attached Images  
    Chris

  5. #5
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    I'd say it just doesn't fit, so change some paramteres in the CreateFont call.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width