Combo Box Selection Value
Is there a way to read the current value of a combo box.
I tried using i = (int)cmb -> SelectedValue; but it is giving me a runtime error.
Example:
Lets say I have a combo box with 5 items. they are a list of numbers spelled out. When one of them is selected, say Three, I want an int to be assigned the current value that is selected. Since Three is the 3rd item in the list then the int variable should be 3, or 2 if the first item is treated as value 0.
Re: Combo Box Selection Value
Re: Combo Box Selection Value
Sorry, but I am not sure what that is and how to use it. I tried some googling, but what ever I try is not working.
Re: Combo Box Selection Value
Re: Combo Box Selection Value
Quote:
Originally Posted by
KazoWAR
Sorry, but I am not sure what that is and how to use it. I tried some googling, but what ever I try is not working.
Didn't seem that hard to me. Always check MSDN first.
Google
Re: Combo Box Selection Value
'System::Windows::Forms::ComboBox'
That is what its using, I am using the designer, that is the only combo box listed, I found CComboBox::GetCurSel, but it doesn't work for ComboBox.
'GetCurSel' : is not a member of 'System::Windows::Forms::ComboBox'
Re: Combo Box Selection Value
Quote:
Originally Posted by
KazoWAR
'System::Windows::Forms::ComboBox'
That is what its using, I am using the designer, that is the only combo box listed, I found CComboBox::GetCurSel, but it doesn't work for ComboBox.
'GetCurSel' : is not a member of 'System::Windows::Forms::ComboBox'
You're using .net, which is off topic in this forum. Try the managed C++ forum.
Re: Combo Box Selection Value
Quote:
Originally Posted by
GCDEF
You're using .net, which is off topic in this forum. Try the managed C++ forum.
Oh sorry, Since I am using Visual C++ I though this was the best place.