Binding an enum to a WinForms combo box, and then setting it

前端 未结 28 2116
心在旅途
心在旅途 2020-11-28 04:33

a lot of people have answered the question of how to bind an enum to a combo box in WinForms. Its like this:

comboBox1.DataSource = Enum.GetValues(typeof(MyE         


        
28条回答
  •  隐瞒了意图╮
    2020-11-28 04:50

    Old question perhaps here but I had the issue and the solution was easy and simple, I found this http://www.c-sharpcorner.com/UploadFile/mahesh/1220/

    It makes use of the databining and works nicely so check it out.

提交回复
热议问题