【发布时间】:2010-11-20 13:21:50
【问题描述】:
我正在将一个字典绑定到一个保留枚举值的组合框。
要检索我使用的选定值:comboBox1.SelectedItem 返回维度值[0,Permanent]。
我只想检索Permanent,然后将其转换回 Enum。
类似:Employee.JobType = Enum.Parse(JobType, comboBox1.SelectedItem)
我怎样才能做到这一点?
【问题讨论】:
-
嗨 Employee.JobType = (JobType)comboBox1.SelectedValue 试试这个
标签: c# winforms enums combobox