private void cboSourceLayer_SelectedIndexChanged(object sender, EventArgs e) { try { pSnippet.AddFieldsForTwoCbo(cboSourceLayer.Text, pActiveView, mForm, cboValueField, cboUncernFld); int intLIndex = pSnippet.GetIndexNumberFromLayerName(pActiveView, cboSourceLayer.Text); ILayer pLayer = mForm.axMapControl1.get_Layer(intLIndex); pFLayer = pLayer as IFeatureLayer; pFClass = pFLayer.FeatureClass; intNofFeatures = pFClass.FeatureCount(null); IFields fields = pFClass.Fields; cboValueField.Items.Clear(); cboUncernFld.Items.Clear(); for (int i = 0; i < fields.FieldCount; i++) { cboValueField.Items.Add(fields.get_Field(i).Name); cboUncernFld.Items.Add(fields.get_Field(i).Name); } } catch (Exception ex) { MessageBox.Show(this.Handle.ToString() + " Error:" + ex.Message); return; } }
private void cboSourceLayer_SelectedIndexChanged(object sender, EventArgs e) { pSnippet.AddFieldsForTwoCbo(cboSourceLayer.Text, pActiveView, mForm, cboValueField, cboUField); }