private void btnEdit_Click(object sender, EventArgs e) { string subjectCode = dataGridView1.Rows[dataGridView1.CurrentRow.Index].Cells[0].Value.ToString(); FrmAddSubject frmAddSub = new FrmAddSubject(subjectCode); frmAddSub.ShowDialog(this); }
private void btnNew_Click(object sender, EventArgs e) { DialogResult dr2; FrmAddSubject frmAddSub = new FrmAddSubject(); DialogResult dr = frmAddSub.ShowDialog(this); while (dr == DialogResult.Yes) { ViewSubject(); dr2 = frmAddSub.ShowDialog(this); if (dr2 == DialogResult.Cancel) { break; } } }