Selecting default item from Combobox C#

前端 未结 7 974
灰色年华
灰色年华 2021-01-03 18:25

I have few items on my ComboBox items collection, and i\'d like to select one item from this list and set it as default item - when app starts - this item is al

7条回答
  •  梦毁少年i
    2021-01-03 18:31

    first, go to the form load where your comboBox is located,

    then try this code

    comboBox1.SelectedValue = 0; //shows the 1st item in your collection

提交回复
热议问题