string LabName = comboBoxLabNumber.SelectedItem.ToString(); string LabNumber = LabName; string LabProblem = comboBoxProblem.SelectedItem.ToString(); string LabProb = LabProblem;
if(comboBoxLabNumber.SelectedIndex > -1) { LabName = comboBoxLabNumber.SelectedItem.ToString(); } else { MessageBox.Show("Please select an item!"); }
try { LabName = comboBoxLabNumber.SelectedItem.ToString(); } catch (Exception e) { MessageBox.Show("Please select an item from the list"); // here take the appropriate action. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)