c#记事本的打印代码怎么写呢?
1个回答
2013-07-16
展开全部
this.printDialog1.Document=this.printDocument1;
this.printDialog1.PrinterSettings=this.pageSetupDialog1.PrinterSettings;
if(this.printDialog1.ShowDialog()==DialogResult.OK)
{
try
{
this.printDocument1.Print();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message,"错误信息",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
this.printDialog1.PrinterSettings=this.pageSetupDialog1.PrinterSettings;
if(this.printDialog1.ShowDialog()==DialogResult.OK)
{
try
{
this.printDocument1.Print();
}
catch(Exception ex)
{
MessageBox.Show(ex.Message,"错误信息",MessageBoxButtons.OK,MessageBoxIcon.Error);
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询