c# - ToolStripComboBox in overflow -
i created form tool strip menu. there lot of items in tool strip. items consist of toolstripbutton, toolstriplabel , toolstripcombobox.
problem combobox data source doesn't initialize when in overflow
this code
public partial class form2 : form { public form2() { initializecomponent(); } private void form2_load(object sender, eventargs e) { var data1 = new list<tvpair>{ new tvpair{ text = "text1", value = 1 }, new tvpair{ text = "text2", value = 2 }, new tvpair{ text = "text3", value = 3 }, new tvpair{ text = "text4", value = 4 }, }; toolstripcombobox1.combobox.displaymember = "text"; toolstripcombobox1.combobox.valuemember = "value"; toolstripcombobox1.combobox.datasource = data1; var data2 = new list<tvpair>{ new tvpair{ text = "text1", value = 1 }, new tvpair{ text = "text2", value = 2 }, new tvpair{ text = "text3", value = 3 }, new tvpair{ text = "text4", value = 4 }, }; toolstripcombobox2.combobox.displaymember = "text"; toolstripcombobox2.combobox.valuemember = "value"; toolstripcombobox2.combobox.datasource = data2; } } class tvpair { public string text { get; set; } public int value { get; set; } }
sorry bad english. beforehand.
Comments
Post a Comment