private void 计算ToolStripMenuItem_Click(object sender, EventArgs e) { int indexNum = dataGridView1.CurrentCell.ColumnIndex; string strField = dataGridView1.Columns[indexNum].HeaderText.ToString(); ILayer pLayer = currentLayer; IFeatureLayer pFLayer = pLayer as IFeatureLayer; CalculateField formcalfield = new CalculateField(pFLayer, dataGridView1, strField); formcalfield.Show(); }
//调用字段计算器窗口 private void button5_Click(object sender, EventArgs e) { int indexNum = dataGridView1.CurrentCell.ColumnIndex; string strField = dataGridView1.Columns[indexNum].HeaderText.ToString(); ILayer pLayer = currentLayer; IFeatureLayer pFeatureLayer = pLayer as IFeatureLayer; CalculateField calculate = new CalculateField(pFeatureLayer, dataGridView1, strField); calculate.Show(); }