![]() |
How to create variable for a dynamically created combo box
I have written this code and now i have dynamically create combo box.
Code:
When a user clicks an item in the combo box to select it, I want to find out what the user clicked. I am interested in the string that the user selected in the combo box,but i need variable for this dinamically created combo box. My question is how to create a variable. I hope you understand what i want to do and i am sorry for my bad English |
Re: How to create variable for a dynamically created combo box
Make Combo box pointer class variable and then get the selected item from the combo box variable
|
Re: How to create variable for a dynamically created combo box
Thank you, but I have been learning Visual C++, WInApi and MFC for not long time I don't know how to do it.
Can you tell me how to make Combo box pointer class variable and then get the selected item from the combo box variable |
Re: How to create variable for a dynamically created combo box
You should then be doing your hands on with C++ because how to put a variable in a class is nothing to do with VC++. The variable pointer you declared in your above code should be moved to CProjectDlg class member variable.
|
Re: How to create variable for a dynamically created combo box
This is what I made.
ProjectDlg.h file Code:
class CProjectDlg : public CDialogProjectDlg.cpp Code:
BOOL CProjectDlg::OnInitDialog()Can you help me further? Or give me a link with this information |
Re: How to create variable for a dynamically created combo box
Quote:
CString str; Combo->GetLBText( nIndex, str); and get the current item selected. Hope this helps. |
| All times are GMT +5.5. The time now is 07:23. |