Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ComoboBox values

 
Nick Howell
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was wondering if anyone oculd tell me if there was a way to assign values to combo box items so that when the user selects an item I can immediately reference the numeric value of the item. Like in html where you write:
<select>
<option value="12345">Option A</option>
<option value="67890">Option B</option>
</select>
I know how to read the item text or selected index and then use a conditional statement but that seems like a lot of unnecessary work. Thanks.
 
Steve Deadsea
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can put whatever type of object you desire in a ComboBox. You could put a custom type of object in it that has a name and a value:

You would then use

And you could make the value any type that you want. It wouldn't have to be a String.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic