[英]My code is not switching to the desired function depending upon the selection from combo box c#
即使我從下拉列表中選擇了 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;
然后與“化學”比較
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.