|
-
November 12th, 2009, 06:19 AM
#1
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.
-
November 12th, 2009, 06:27 AM
#2
Re: Combo Box Selection Value
-
November 12th, 2009, 07:20 AM
#3
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.
-
November 12th, 2009, 07:22 AM
#4
Re: Combo Box Selection Value
Victor Nijegorodov
-
November 12th, 2009, 08:17 AM
#5
Re: Combo Box Selection Value
 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
-
November 12th, 2009, 06:15 PM
#6
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'
-
November 12th, 2009, 06:43 PM
#7
Re: Combo Box Selection Value
 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.
-
November 12th, 2009, 07:19 PM
#8
Re: Combo Box Selection Value
 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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|