kopia lustrzana https://github.com/njcrawford/EmbroideryReader
Catch InvalidPrinterException when showing print preview dialog. Should resolve issue #14.
rodzic
612b8d0a24
commit
aeb8aaf6e4
|
@ -559,8 +559,15 @@ namespace embroideryReader
|
||||||
|
|
||||||
private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e)
|
private void printPreviewToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
printPreviewDialog1.Document = printDocument1;
|
try
|
||||||
printPreviewDialog1.ShowDialog();
|
{
|
||||||
|
printPreviewDialog1.Document = printDocument1;
|
||||||
|
printPreviewDialog1.ShowDialog();
|
||||||
|
}
|
||||||
|
catch(System.Drawing.Printing.InvalidPrinterException pex)
|
||||||
|
{
|
||||||
|
MessageBox.Show("Unable to find a default printer: " + pex.Message + Environment.NewLine + Environment.NewLine + "Possible reasons include: no printers are installed, or no printer is set as the default.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
|
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
|
||||||
|
|
Ładowanie…
Reference in New Issue