private void btnPreviewInvoice_Click_1(object sender, EventArgs e) { GenerateInvoicePDF(); PreviewInvoice previewInvoice = new PreviewInvoice(); previewInvoice.InvoiceId = String.IsNullOrEmpty(txtInvoiceNumber.Text) ? 0 : Convert.ToInt32(txtInvoiceNumber.Text); previewInvoice.InvoiceFolderPath = InvoiceFolderPath; previewInvoice.StartPosition = FormStartPosition.CenterParent; previewInvoice.ShowDialog(this); }