C# Set combo item with selectedValue

前端 未结 6 705
生来不讨喜
生来不讨喜 2020-12-11 03:55

I am dynamically creating a combobox like this:

public Control GenerateList(Question question)
{
    // Get a list with answer possibilities
    List

        
6条回答
  •  旧时难觅i
    2020-12-11 04:23

    Solution:

    The SelectedValue, SelectedIndex, SelectedItem properties can't be set until the control is added to the form. After the control is added to the form, the selectedValue, -Index and -Item properties can be set.

提交回复
热议问题