T
thechaosengine
Hi all,
I have a problem that I havent really come accross before.
I need to be able to allow the user to set a dropdown control to a particular
colour value. The permissable values come from the Color enumeration and
unfortunately I can't change this implementation detail.
My question is, how can I load the values into the dropdown using the enumeration,
and more importantly, when a user selects an entry in the dropdown, how do
I reconcile the selected value back into a Color from the enumeration?
The only solution that I could really think of was quite a messy approach
using lots of conditional statements and I'm thinking there must be a more
elegant way.
Quite why it was implemented using the Color enum I don't know. I would have
chosen a string personally.
Many thanks to anybody who could offer advice on how to approach this
Kindest Regards
thechaosengine
I have a problem that I havent really come accross before.
I need to be able to allow the user to set a dropdown control to a particular
colour value. The permissable values come from the Color enumeration and
unfortunately I can't change this implementation detail.
My question is, how can I load the values into the dropdown using the enumeration,
and more importantly, when a user selects an entry in the dropdown, how do
I reconcile the selected value back into a Color from the enumeration?
The only solution that I could really think of was quite a messy approach
using lots of conditional statements and I'm thinking there must be a more
elegant way.
Quite why it was implemented using the Color enum I don't know. I would have
chosen a string personally.
Many thanks to anybody who could offer advice on how to approach this
Kindest Regards
thechaosengine