Combo boxes duplicate entries

前端 未结 4 1273
醉话见心
醉话见心 2021-01-07 01:27

I am adding items to combo box using comboBox.Items.Add(entry);. But how can I avoid duplicate entries (i.e same name entries) in combobox. Is there any lib fun

4条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-07 01:35

    Use an HashSet class to bind the control, how depens from the presentation technology, or use the Distinct method of LINQ to filter duplicates.

提交回复
热议问题