private void Button1Click(object sender, EventArgs e) { iForm iForm = new A4(); iForm.Data = this.textBox2.Text; iForm.SetText(); iForm.ShowDialog(); this.textBox2.Text = iForm.Data; }
private void GridCellClick(object sender, DataGridViewCellEventArgs e) { int columnIndex = e.ColumnIndex; int rowIndex = e.RowIndex; if (((columnIndex == 3) && (e.RowIndex != -1)) && !this.DataGridView1.Rows[e.RowIndex].IsNewRow) { iForm form; string str = Convert.ToString(this.DataGridView1.Rows[rowIndex].Cells[1].Value); string str2 = Convert.ToString(this.DataGridView1.Rows[rowIndex].Cells[3].Value); switch (str.ToUpper()) { case "A2": form = new A2(); form.Data = str2; form.SetText(); form.ShowDialog(); this.DataGridView1.Rows[rowIndex].Cells[3].Value = form.Data; break; case "A3": form = new A3(); form.Data = str2; form.SetText(); form.ShowDialog(); this.DataGridView1.Rows[rowIndex].Cells[3].Value = form.Data; break; case "A4": form = new A4(); form.Data = str2; form.SetText(); form.ShowDialog(); this.DataGridView1.Rows[rowIndex].Cells[3].Value = form.Data; break; case "A5": form = new A5(); form.Data = str2; form.SetText(); form.ShowDialog(); this.DataGridView1.Rows[rowIndex].Cells[3].Value = form.Data; break; case "A6": form = new A6(); form.Data = str2; form.SetText(); form.ShowDialog(); this.DataGridView1.Rows[rowIndex].Cells[3].Value = form.Data; break; case "A9": form = new A9(); form.Data = str2; form.SetText(); form.ShowDialog(); this.DataGridView1.Rows[rowIndex].Cells[3].Value = form.Data; break; case "A25": form = new A25(); form.Data = str2; form.SetText(); form.ShowDialog(); this.DataGridView1.Rows[rowIndex].Cells[3].Value = form.Data; break; } } }