|
-
November 12th, 2009, 07:27 PM
#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.
-
December 5th, 2009, 01:21 PM
#2
Re: Combo Box Selection Value
Try...
Code:
int i = cmb->SelectedIndex;
string equivalent would be...
Code:
cmb->SelectedIndex.ToString();
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
|