private void FillComboBox() { SelectionTargetComboBox selCombo = SelectionTargetComboBox.GetSelectionComboBox(); if (selCombo == null) { return; } selCombo.ClearAll(); IFeatureLayer featureLayer; // Loop through the layers in the map and add the layer's name to the combo box. for (int i = 0; i < m_map.LayerCount; i++) { if (m_map.get_Layer(i) is IFeatureSelection) { featureLayer = m_map.get_Layer(i) as IFeatureLayer; if (featureLayer == null) { break; } selCombo.AddItem(featureLayer.Name, featureLayer); } } }