public int getFeatureOrder(String theName, ListBox lstBox) { if (lstBox.Items.Count > 0) for (int i = 0; i < lstBox.Items.Count; i++) { if (lstBox.Items[i].ToString() == theName) { return i; } } return -1; }