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. Combobox member variable messages? I can get ON_CBN_SELCHANGE but not ON_CBN_KILLFOCUS?

Combobox member variable messages? I can get ON_CBN_SELCHANGE but not ON_CBN_KILLFOCUS?

Scheduled Pinned Locked Moved C / C++ / MFC
question
2 Posts 2 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.
  • M Offline
    M Offline
    mhowes
    wrote on last edited by
    #1

    I have two different situations where I have comboboxes that are part of a view. I can't seem to get all the combobox messages. A. I have a member variable that is part of a listview class. I make a handler for ON_CBN_SELCHANGE and I get that just fine, but I make a handler for ON_CBN_KILLFOCUS and I don't get that message??? I can get a ON_EN_KILLFOCUS for a CEdit member of the same view. Is there something special about ON_CBN_KILLFOCUS? B. I have, also in this view, a combobox, added to a toolbar. Both are members of the view. I do all the positioning myself. The toolbar's parent is the listview (this) and the comboboxes parent is the toolbar (m_tbrColumns). How can I get the messages for the combobox in the view?? I don't get any messages for this combobox in the view. thanks mike

    T 1 Reply Last reply
    0
    • M mhowes

      I have two different situations where I have comboboxes that are part of a view. I can't seem to get all the combobox messages. A. I have a member variable that is part of a listview class. I make a handler for ON_CBN_SELCHANGE and I get that just fine, but I make a handler for ON_CBN_KILLFOCUS and I don't get that message??? I can get a ON_EN_KILLFOCUS for a CEdit member of the same view. Is there something special about ON_CBN_KILLFOCUS? B. I have, also in this view, a combobox, added to a toolbar. Both are members of the view. I do all the positioning myself. The toolbar's parent is the listview (this) and the comboboxes parent is the toolbar (m_tbrColumns). How can I get the messages for the combobox in the view?? I don't get any messages for this combobox in the view. thanks mike

      T Offline
      T Offline
      Tomasz Sowinski
      wrote on last edited by
      #2

      Answer to (b): If you want MFC message maps to work, you'll have to override toolbar's OnCmdMsg. You should call the view's OnCmdMsg first:

      BOOL CYourToolbar::OnCmdMsg(...)
      {
      if (m_pParent->OnCmdMsg(...))
      {
      return TRUE;
      }

      return CToolBar::OnCmdMsg(...);
      }

      Tomasz Sowinski -- http://www.shooltz.com

      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