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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Subclassing CDateTimeCtrl

Subclassing CDateTimeCtrl

Scheduled Pinned Locked Moved C / C++ / MFC
agentic-aihelptutorialquestion
1 Posts 1 Posters 0 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.
  • P Offline
    P Offline
    Pir8ofTampa
    wrote on last edited by
    #1

    Created and editable CListCtrl. Trying to subclass CDateTimeCtrl - unable to handle using VK_TAB and forcing the subclassed control to lose focus and destroy itself. Reasoning: When using the drop-down, obviously, CDateTimeCtrl loses focus, but can't figure out how to keep control visible until all user intervention is complete - or naturally, it loses focus to the next column, or other object. I tried overiding OnKillFocus: void CdtkDate::OnKillFocus(CWnd* pNewWnd) { CDateTimeCtrl::OnKillFocus(pNewWnd); CMonthCalCtrl* pMonCalCtrl = this->GetMonthCalCtrl(); // But CMonthCalCtrl doesn't get focus until the user selects it, // Even though it is visible - should I force this focus? if(pNewWnd->m_hWnd == pMonCalCtrl->m_hWnd) return; DestroyWindow(); } This Class will not always destroy itself - and I get an error when the application instance is terminated. Any suggestions will be appreciated.

    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