private void b_DispenseMedicine_Click(object sender, EventArgs e) { //if (grid.RowCount == 1) // MessageBox.Show("No Lab tests scheduled for the day!!!\nEnter an MRN to perform a lab test"); //else // { f_PharmacyHomeScreen home = this; DataGridViewRow row = infodetailtable.CurrentRow; string MRN = row.Cells[0].Value.ToString(); string date = row.Cells[1].Value.ToString(); int mrn = Convert.ToInt16(MRN); f_PharmacyForm med = new f_PharmacyForm(mrn, date); med.Show(); home.Dispose(); //} }