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 in win32

Combobox in win32

Scheduled Pinned Locked Moved C / C++ / MFC
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.
  • R Offline
    R Offline
    Rajeev Goutham
    wrote on last edited by
    #1

    HI , I struck in below scenario. please put some light on it. I have one combobox and edit control in win32 application. 1. i keep on updating my combobox with new data, but while doing that, previous data in combobox missing. 2. when i choose one data item in combobox corresponding value should be updated in edit box. Thanks, Goutham.

    enhzflepE _ 2 Replies Last reply
    0
    • R Rajeev Goutham

      HI , I struck in below scenario. please put some light on it. I have one combobox and edit control in win32 application. 1. i keep on updating my combobox with new data, but while doing that, previous data in combobox missing. 2. when i choose one data item in combobox corresponding value should be updated in edit box. Thanks, Goutham.

      enhzflepE Offline
      enhzflepE Offline
      enhzflep
      wrote on last edited by
      #2

      Gday. 1. How are you updating the combo box? Please show some code 2. You simply handle CBN_SELENDOK notification messages, when you get one - you ask for the currently selected string then send it to the edit-control. Note: Selecting an existing item and typing an item into the edit box of the combo-box control send different messages. If you can't(shouldn't) type into the edit box, you should probably be using a list control instead. CBN_SELENDOK[^]

      1 Reply Last reply
      0
      • R Rajeev Goutham

        HI , I struck in below scenario. please put some light on it. I have one combobox and edit control in win32 application. 1. i keep on updating my combobox with new data, but while doing that, previous data in combobox missing. 2. when i choose one data item in combobox corresponding value should be updated in edit box. Thanks, Goutham.

        _ Offline
        _ Offline
        _Superman_
        wrote on last edited by
        #3

        How are you adding new data? Please post relevant code. In Win32, you have to send the CB_ADDSTRING[^] message to the combo box to add a new string to the list. Or you can use the very convenient ComboBox_AddString[^] macro for this. When an item is selected, the CBN_SELCHANGE[^] notification message is sent. You need to handle that in your code. You will need to send CB_GETCURSEL[^] or use the ComboBox_GetCurSel[^] macro to get the new selection index. To get the text string, send CB_GETLBTEXT[^] or use the ComboBox_GetLBText[^] macro.

        «_Superman_»  _I love work. It gives me something to do between weekends.

        _Microsoft MVP (Visual C++)

        Polymorphism in C

        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