Creating a Group Combo Box
Environment: VC6.0, W2K
The purpose of this article is to demonstrate a sample class to "group" the MFC CComboBox class. The grouping allows the user to make an assignment from a set of values.
For example, if a user wanted to map several IP addresses in a one-to-one relationship, the software could show all the available IP addresses, and allow the user to select the mapping. When an IP address is selected, that IP address is removed from the other combo boxes in the list. When an IP address is unselected, the address is added to all the other combo boxes in the list.
In the Demo Project (provided below and shown above), variables one through five are mapped to choices one through six. Obviously, there are more choices than variables, but only the "Not Selected" choice can be selected in multiple combo boxes at any time. When the OK button is pressed, the values of the choices are reported to the user in a message box.
Also, while this class is relatively simple, I am new at developing Windows software, and would appreciate any constructive feedback. If you notice anything that I could have done better, or any errors, PLEASE send me an e-mail to let me know your thoughts.
Downloads
Download demo project - 45 KbDownload source - 5 Kb

Comments
How we can add an string to list box item of combobox by code?
Posted by Legacy on 05/01/2003 12:00amOriginally posted by: zeinalzadeh
How we can add an string to list box item of combobox by code.While I exit from program that string value be saved on list box data of combobox?
ReplyBetter way
Posted by Legacy on 04/07/2003 12:00amOriginally posted by: Alex
Reply