private void courseToolStripMenuItem_Click(object sender, EventArgs e) { if (ActiveMdiChild != null) { ActiveMdiChild.Close(); } Frm_Course objcrs = new Frm_Course(); objcrs.MdiParent = this; objcrs.Show(); clearhome(); }
private void dataGridView1_CellClick_1(object sender, DataGridViewCellEventArgs e) { if (e.ColumnIndex == 5) { DataGridViewRow row = dataGridView1.Rows[e.RowIndex]; Frm_Course objCrs = new Frm_Course(); //populate the textbox from specific value of the coordinates of column and row. Frm_CourseView.crs_id = row.Cells[4].Value.ToString(); Frm_CourseView.crs_code = row.Cells[1].Value.ToString(); Frm_CourseView.crs_name = row.Cells[2].Value.ToString(); Frm_CourseView.crs_desc = row.Cells[3].Value.ToString(); Frm_CourseView.flag = 1; objCrs.Show(); } }