private void B_Add_Click(object sender, EventArgs e) { NewIndex = Dgv_Sum.Rows.Add(); FormName MainForm = new FormName(NewIndex, Dgv_Sum); MainForm.ShowDialog(); if (GlobalValue.connectvalue[NewIndex].FormName != "" && GlobalValue.connectvalue[NewIndex].FormName != null) { Dgv_Sum.Rows[NewIndex].Cells["Instrument"].Value = GlobalValue.connectvalue[NewIndex].FormName; TranslateUnit instr = new TranslateUnit(NewIndex); GlobalValue.connectvalue[NewIndex].IsHiden = false; GlobalValue.connectvalue[NewIndex].ConParm.InitValue(); instr.Show(); } else { Dgv_Sum.Rows.Remove(Dgv_Sum.Rows[NewIndex]); } Add(); if (EnableReg == true) { UpdateReg(Dgv_Sum.RowCount); } }
public void Add() { NewIndex = Dgv_Sum.Rows.Add(); FormName MainForm = new FormName(NewIndex, Dgv_Sum); MainForm.ShowDialog(); if (GlobalValue.connectvalue[NewIndex].FormName != "" && GlobalValue.connectvalue[NewIndex].FormName != null) { Dgv_Sum.Rows[NewIndex].Cells["Instrument"].Value = GlobalValue.connectvalue[NewIndex].FormName; TranslateUnit instr = new TranslateUnit(NewIndex); GlobalValue.connectvalue[NewIndex].IsHiden = false; GlobalValue.connectvalue[NewIndex].ConParm.InitValue(); instr.Show(); } else { Dgv_Sum.Rows.Remove(Dgv_Sum.Rows[NewIndex]); } }