How to Set default combobox

前端 未结 5 1639
梦谈多话
梦谈多话 2021-02-19 00:48

So I\'ve been looking to set a default value for my combobox. I found a few things but none of them seem to work.

Actually, it works if I create a simple combobox and us

5条回答
  •  孤街浪徒
    2021-02-19 00:59

    It looks like you're searching the cbxCategory.Items collection for a string, but it contains items of type ComboBoxItem. Therefore the search will return -1.

提交回复
热议问题