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

CComboBox Q.

Scheduled Pinned Locked Moved C / C++ / MFC
questiondata-structurestutorial
4 Posts 4 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
    RalfPeter
    wrote on last edited by
    #1

    I need to extract multiple items from a CComboBox and stick them in an array. How do I do the extraction? I believe that by pressing down the ctrl key will select the items, but how to I implement the extraction? Thx, Ralf. ralf.riedel@usm.edu

    A 1 Reply Last reply
    0
    • R RalfPeter

      I need to extract multiple items from a CComboBox and stick them in an array. How do I do the extraction? I believe that by pressing down the ctrl key will select the items, but how to I implement the extraction? Thx, Ralf. ralf.riedel@usm.edu

      A Offline
      A Offline
      Alexander M
      wrote on last edited by
      #2

      GetLBText method retrieves the string chosen by the combobox! Don't try it, just do it! ;-)

      A 1 Reply Last reply
      0
      • A Alexander M

        GetLBText method retrieves the string chosen by the combobox! Don't try it, just do it! ;-)

        A Offline
        A Offline
        Anonymous
        wrote on last edited by
        #3

        Right, one at a time! But how to retrieve multiple strings? Ralf.

        M 1 Reply Last reply
        0
        • A Anonymous

          Right, one at a time! But how to retrieve multiple strings? Ralf.

          M Offline
          M Offline
          Mike Dimmick
          wrote on last edited by
          #4

          You can't do a multiple selection in a combo box. You need to use a list box to support multiple selections. If you really need the edit control as well, you'll have to add one of your own. In a list box (CListBox), you need to iterate over the list of items using GetSel to find out if the item is selected. For a ListView control (CListCtrl in MFC), you can use GetFirstSelectedItemPosition and GetNextSelectedItem to find out the set of selected items. Technically, the combo control is made up of an edit control and a list box, so you probably could find the handle of the list box and send messages to it directly. This isn't nice, though.

          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