private void dgDisplay_CellContentClick(object sender, DataGridViewCellEventArgs e) { string name = (string)dgDisplay.CurrentRow.Cells[1].Value.ToString(); Patient patient = new Patient(); patient.Name = name; ScanningForm scanform = new ScanningForm(); scanform.Show(); this.Close(); }