开发者

how to do: what i pick on combobox1 will show on combobox2?

开发者 https://www.devze.com 2022-12-23 20:04 出处:网络
how to do: what i pick on combobox1 will s开发者_如何学Pythonhow on combobox2 ? is it possible ?(in C#)

how to do: what i pick on combobox1 will s开发者_如何学Pythonhow on combobox2 ?

is it possible ? (in C#)

thank's in advance


You need to subscride second combobox on the SelectedIndexChanged event of the first combobox and change value when event triggers. Also you need to make sure that both combobox have several items or you will need to add missing items to second combobox dynamically.

Event handler example:

    private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    {
        object selectedValue = this.comboBox1.SelectedValue;
        this.comboBox2.SelectedValue = selectedValue;
    }
0

精彩评论

暂无评论...
验证码 换一张
取 消