You wrote: "no it`s not for database." My question about the data for the internal values of the Enum was meant to find out if the values
came from a database.
Check out "Enum Code Generator - Generating enum code automatically from database look up tables"[
^].
And, this discussion on StackOverFlow may interest you:[
^].
The question of how, once you have, at runtime, created a valid Enum you can then declare a property in a UserControl of the type of that Enum is a very interesting one.
My guess ... for what that's worth ... is that either you then have to use Reflection and dynamically modify the UserControl instance in memory at run-time, or you have use the 'dynamic' keyword in your UserControl so the Enum, is, essentially, "late bound."
But, as you may know, Enums are kind of special creatures, more value types than anything else, and whether you could use 'dynamic' in a UserControl, and get late-binding on an Enum ... sorry to say ... is beyond my skills, technically.
I'd be interested to know the answer to that one, also.
good luck, Bill