how to do: what i pick on combobox1 will show on combobox2?
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;
}
精彩评论