I tring with frustration to populate a combo box in c# but not using a database
e.g. combobox displays
red
white
blue
But want i want is if a person chooses red i want to pass back the number 1 value to another method
i'm able to populate a combo box with the colours but not sure how i 'grab' the value to pass back
string[] colours = new string[] { "red", "white", "blue" };
m_cmbColours.Items.AddRange(colours);
What i want is this
value colour
1 red
2 white
3 blue
combo box just displays the colours and when chosen in the combo box i grab the value corresponding to colour chosen
any help much appreciated
e.g. combobox displays
red
white
blue
But want i want is if a person chooses red i want to pass back the number 1 value to another method
i'm able to populate a combo box with the colours but not sure how i 'grab' the value to pass back
string[] colours = new string[] { "red", "white", "blue" };
m_cmbColours.Items.AddRange(colours);
What i want is this
value colour
1 red
2 white
3 blue
combo box just displays the colours and when chosen in the combo box i grab the value corresponding to colour chosen
any help much appreciated