CComboBox Q.
-
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
-
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
GetLBText method retrieves the string chosen by the combobox! Don't try it, just do it! ;-)
-
GetLBText method retrieves the string chosen by the combobox! Don't try it, just do it! ;-)
-
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 usingGetSel
to find out if the item is selected. For a ListView control (CListCtrl
in MFC), you can useGetFirstSelectedItemPosition
andGetNextSelectedItem
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.