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. CComboBox

CComboBox

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

    Hi all! Let's say I have 5 combo boxes in 1 dialog box. Instead of having 5 different functions to control the OnSelChange() events of those combo boxes, can I just have 1 function to handle all 5 combo boxes? I guess what I am asking is that if there exists a function call so that you can tell which one sends the request. Thank You Vu vucsuf

    M M 2 Replies Last reply
    0
    • V Vu Nguyen

      Hi all! Let's say I have 5 combo boxes in 1 dialog box. Instead of having 5 different functions to control the OnSelChange() events of those combo boxes, can I just have 1 function to handle all 5 combo boxes? I guess what I am asking is that if there exists a function call so that you can tell which one sends the request. Thank You Vu vucsuf

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      You can call CWnd::GetCurrentMessage() which will return the MSG struct for the notification message. Combobox notifications are sent with WM_COMMAND, so you can grab the control ID/HWND from wParam and lParam. --Mike-- http://home.inreach.com/mdunn/ "The Earth is doomed." -- Rupert Giles :love: your :bob: with :vegemite: and :beer:

      1 Reply Last reply
      0
      • V Vu Nguyen

        Hi all! Let's say I have 5 combo boxes in 1 dialog box. Instead of having 5 different functions to control the OnSelChange() events of those combo boxes, can I just have 1 function to handle all 5 combo boxes? I guess what I am asking is that if there exists a function call so that you can tell which one sends the request. Thank You Vu vucsuf

        M Offline
        M Offline
        Masaaki Onishi
        wrote on last edited by
        #3

        Hello, the codegurus around the world.;) The other way is that you create only one OnSelChange(), and assign this function inside the message map. That is, all five ComboBoxes share one OnSelChange(). (Or create your own function associated the message) And, we can check which ComboBox get the input focus when this message is checked. I guess that this works.:confused: Have a nice day!

        -Masaaki Onishi-

        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