[英]My code is not switching to the desired function depending upon the selection from combo box c#
The code is not invoking the show_auto function even though I have selected the CHEMICAL from the drop down, it is always invoking the show_cement function.即使我从下拉列表中选择了 CHEMICAL,代码也没有调用 show_auto function,它总是调用 show_cement function。
private void gunaComboBox1_SelectedIndexChanged(object sender, EventArgs e) {
ArrayList companyName = new ArrayList();
ArrayList Price = new ArrayList();
ArrayList category = new ArrayList();
String selected = this.gunaComboBox1.GetItemText(this.gunaComboBox1.SelectedItem);
if (selected.Equals("CHEMICAL")) {
show_auto(companyName, Price, selected);
} else {
show_cement(companyName, Price, "CEMENT");
}
}
String selected = gunaComboBox1.selecteditem.text;
and then compare with "CHEMICAL"然后与“化学”比较
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.