private void btnThem_Click(object sender, EventArgs e) { FormThem_CapNhatTacGia newForm = new FormThem_CapNhatTacGia(); this.Visible = false; newForm.Show(); newForm.Disposed += NewForm_Disposed; }
private void btnSua_Click(object sender, EventArgs e) { DataGridViewRow row = dataGVTacGia.SelectedRows.Count >= 1 ? dataGVTacGia.SelectedRows[0] : null; if (row != null) { string maTacGia = row.Cells["colMaTG"].Value.ToString(); string tenTacGia = row.Cells["colTenTG"].Value.ToString(); FormThem_CapNhatTacGia newForm = new FormThem_CapNhatTacGia(maTacGia, tenTacGia); this.Visible = false; newForm.Show(); newForm.Disposed += NewForm_Disposed; } else { MessageBox.Show("Bạn chưa chọn tác giả để sửa"); } }