Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CDateTimeCtrl

CDateTimeCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
questionhelp
21 Posts 5 Posters 5 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S sschilachi

    No, I looked absolutely everywhere and tried just about everything but I eventually gave up as I couldn't find a solution anywhere. If I do have any success I will let you know, and could you do the same if you find a solution. Thanks

    D Offline
    D Offline
    DRHuff
    wrote on last edited by
    #21

    Well I worked around it so that I can use it the way I want!:-D:-D:-D Basically I added an invisible Month Calendar control which I then set to the same space as the DateTimePickers rect in the DropDown handler. I also set a flag for bMonthShowing. In the OnPaint method I use the bMonthShowing flag to let me know to reposition the windows m_pMonth->SetWindowPos(&wndNoTopMost, 0, 0, 1, 1, SWP_NOMOVE | SWP_SHOWWINDOW); m_ctlMonth.SetWindowPos(&wndTopMost, 0, 0, 1, 1, SWP_NOMOVE | SWP_SHOWWINDOW); In the CloseUp handler I set the MonthCalendar invisible. For the month calendar I handle the GetDayStates to set which days I want bold. In the OnSelect for the month calendar I do the following: COleDateTime t; SYSTEMTIME tt; BOOL ret = m_ctlMonth.GetCurSel(&tt); t.SetDate(tt.wYear, tt.wMonth, tt.wDay); m_ctlDatePicker.SetTime(t); (If I did the GetCurSel directly into a COleDateTime it comes back with an invalid status :confused: ) And everything works! All right I missed one or two (or more) things. oops What a kludge! If you want I can send you the whole dialog project. Let me know. Dave

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups