W
weischbier
Guest
So I wanted to convert an enum Value to a String.
Then bind this enum to a combobox.
Binding it to a combobox is simple.
I know how to read that from a combobox
But now I want to contain '
Does anybody know hot to do so?
Google gave me nothing ... sad day!
greetz
Weischbier
Then bind this enum to a combobox.
Binding it to a combobox is simple.
Code:
[LEFT]<code class="csharp plain" style="background-image: none !important; background-attachment: initial !important; background-origin: initial !important; background-clip: initial !important; background-color: initial !important; border-top-width: 0px !important; border-right-width: 0px !important; border-bottom-width: 0px !important; border-left-width: 0px !important; border-style: initial; border-color: initial; border-image: initial !important; margin-top: 0px !important; margin-right: 0px !important; margin-bottom: 0px !important; margin-left: 0px !important; padding-top: 0px !important; padding-right: 0px !important; padding-bottom: 0px !important; padding-left: 0px !important; vertical-align: baseline !important; border-top-left-radius: 0px !important; border-top-right-radius: 0px !important; border-bottom-right-radius: 0px !important; border-bottom-left-radius: 0px !important; border-style: initial !important; border-color: initial !important; bottom: auto !important; float: none !important; height: auto !important; left: auto !important; outline-width: 0px !important; outline-style: initial !important; outline-color: initial !important; overflow-x: visible !important; overflow-y: visible !important; position: static !important; right: auto !important; top: auto !important; width: auto !important; box-sizing: content-box !important; font-size: 13px; direction: ltr !important; display: inline !important; ">public enum Behaviour
{
DestroyMyComputer,
LowSpecComputer
}
comboBox1.Datasource = Enum.GetValues(typeof(Behaviour));</code>[/LEFT]
I know how to read that from a combobox
Code:
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
switch ((Behaviour)comboBox1.SelectedItem)
{
case
Behaviour.DestroyMyComputer:
//Bla bla here
break;
case
Behaviour.LowSpecComputer:
//Bla bla here
break;
default:
break;
}
}
But now I want to contain '
DestroyMyComputer
' for example "Destroy my Computer" as a string.Does anybody know hot to do so?
Google gave me nothing ... sad day!
greetz
Weischbier