private void btnPrint_Click(object sender, EventArgs e) { rptReceiptForm report = new rptReceiptForm(this.id.ToString()); report.ShowDialog(); this.SuspendLayout(); this.Close(); }
private void btnPrint_Click(object sender, EventArgs e) { string id = ""; if (gridView.SelectedCells.Count != 0) { try { DataGridViewCell cell = gridView.SelectedCells[0]; DataGridViewRow row = cell.OwningRow; id = row.Cells[0].Value.ToString(); rptReceiptForm report = new rptReceiptForm(id); report.ShowDialog(); this.SuspendLayout(); } catch (Exception ex) { MessageBox.Show(ex.Message.ToString()); } } }