![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
CComboBoxEx OverviewInherits from CComboBox CComboBoxEx is an extension of the CComboBox control. It adds auto completion for the edit control, as well as persistence for the listbox portion of the control by writing the entries to the registry. Before the state is saved, the contents of the edit control is compared against the list and added at the top if not found. Adding persistence is simple. In your OnInitDialog handler add a call to m_ctlMyComboBox.LoadState(_T("Settings\\Combo")); where "Settings\\Combo" is the registry sub-key where the state info will be stored. Note that each control instance should probably have a unique location (unless you want them to share data) In your OnOK handler add a call to m_ctlMyComboBox.SaveState(_T("Settings\\Combo")); To make the text in the edit control auto-complete, call m_ctlMyComboBox.SetAutoComplete(TRUE); That's it. Also, make sure that m_ctlMyComboBox is of type CComboBoxEx. |
Please send any comments or suggestions to grimmd@mediaone.net