private void BTN_PRINT_TEST_Click(object sender, EventArgs e) { try { setWaitCursor(true); if (COM_PRINTER.SelectedItem == null || string.Empty.Equals(COM_PRINTER.SelectedItem.ToString().Trim())) { MetroMessageBox.Show(this, Constants.getMessage("PRINTER_NOTHING"), "Print Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { GTF_ReceiptPrinter printer = new GTF_ReceiptPrinter(null); printer.setPrinter(COM_PRINTER.SelectedItem.ToString()); printer.PrintSlip_Test(); } } finally { setWaitCursor(false); BTN_PRINT_TEST.Focus(); } /* * PrintDocument printDoc = new PrintDocument(); * printDoc.PrinterSettings.PrinterName = COM_PRINTER.SelectedItem.ToString(); * printDoc.PrintPage += new PrintPageEventHandler(printDoc_PrintPage); * printDoc.Print(); */ }
private void BTN_PRINT_TEST_Click(object sender, EventArgs e) { try { setWaitCursor(true); if (COM_PRINTER.SelectedItem == null || "".Equals(COM_PRINTER.SelectedItem.ToString().Trim())) { MetroMessageBox.Show(this, "Printer is not working properly", "Passport Info", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { GTF_ReceiptPrinter printer = new GTF_ReceiptPrinter(null); printer.setPrinter(COM_PRINTER.SelectedItem.ToString()); printer.PrintSlip_Test(); } } finally { setWaitCursor(false); BTN_PRINT_TEST.Focus(); } }