我的组合框正确填充,但是当我在4个框中的1个框中选择一个值时,所有框都采用相同的值。
culturesListNames是来自txt文件的信息,我想申请4个组合框
我的代码:
String[] culturesListNames1 = new String[300];
String[] culturesListNames2 = new String[300];
String[] culturesListNames3 = new String[300];
String[] culturesListNames4 = new String[300];
culturesListNames1 = culturesListNames;
culturesListNames2 = culturesListNames;
culturesListNames3 = culturesListNames;
culturesListNames4 = culturesListNames;
BindingSource theBindingSource1 = new BindingSource();
theBindingSource1.DataSource = culturesListNames1;
BindingSource theBindingSource2 = new BindingSource();
theBindingSource2.DataSource = culturesListNames2;
BindingSource theBindingSource3 = new BindingSource();
theBindingSource3.DataSource = culturesListNames3;
BindingSource theBindingSource4 = new BindingSource();
theBindingSource4.DataSource = culturesListNames4;
comboBox1.DataSource = theBindingSource1.DataSource;
comboBox2.DataSource = theBindingSource2.DataSource;
comboBox3.DataSource = theBindingSource3.DataSource;
comboBox4.DataSource = theBindingSource4.DataSource;`