谁能给个用printpreviewdialog打印printdocument的例子?
我正在学习vb.net打印,直接打印(如打印c:\test.txt)已经解决,如何通过printpreviewdialog控件上的打印按钮来打印,不知道怎样解决?(关键是printpreviewdialog.document怎么引用c:\test.txt)--------------------编程问答-------------------- 参考如下:
private void button2_Click(object sender, EventArgs e)
{
PrintPreviewDialog pd = new PrintPreviewDialog();
pd.Document = new PrintDocument();
pd.Document.PrintPage += new PrintPageEventHandler(Document_PrintPage);
if (pd.ShowDialog(this) == DialogResult.OK)
{
PreviewPrintController c = pd.Document.PrintController as PreviewPrintController;
PreviewPageInfo[] ia = c.GetPreviewPageInfo();
}
}
void Document_PrintPage(object sender, PrintPageEventArgs e)
{
//e.Graphics.DrawImage(...);
}
补充:.NET技术 , VB.NET