supportoranges
asked on
CComboBox how to use MSVS2010 (C++)
Sorry, I'm lost. I create a member variable for a CComboBox and called it m_charts.
In CMainFrame implementation I can instantiate CDialog derived object containing this member variable and I can run AddString() to populate it.
So how do I read strings from it?
Here is how far I've gotten.
1. Class Wizard
2. Choose my resource IDD_REVEAL_STATE which is the dialog box resource
3. Pick member variable tab.
4. Choose the member for the CComboBox
Now what?
I need to start handling messages. I hope I don't have to subclass again. Can you help?
In CMainFrame implementation I can instantiate CDialog derived object containing this member variable and I can run AddString() to populate it.
So how do I read strings from it?
Here is how far I've gotten.
1. Class Wizard
2. Choose my resource IDD_REVEAL_STATE which is the dialog box resource
3. Pick member variable tab.
4. Choose the member for the CComboBox
Now what?
I need to start handling messages. I hope I don't have to subclass again. Can you help?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
the text that is in the editbox of the combobox (either by editing or by selection) can be retrieved by GetWindowText in your dialogs member functions. alternatively, you may add a CString member variable for your combobox in resource editor (right-click + 'Add Variable ...'). then, by UpdateData(TRUE); the CString member was filled with current contents of combobox control from screen (plus all other screen data from controls where you have added a member variable for the value). with UpdateData(FALSE); you can populate your controls from members. that typically is made in OnInitDialog member function.
Sara
Sara
ASKER