0
嗨,我在Windows應用程序中打印面板。當我點擊打印面板後,它打開打印對話框,我點擊打印在打印dailog它是拋出一個異常。無法在c#窗口應用程序中打印面板
System.CompoentModel.Win32Exception{"Access is denied"}
這裏是我使用的代碼。
Bitmap MemoryImage;
private void btnPrint_Click(object sender, EventArgs e)
{
panel1.BackColor = Color.White;
printDialog1.Document = printDocument1;
if (printDialog1.ShowDialog() == DialogResult.OK)
{
printDocument1.Print();
}
}
private void printDocument1_PrintPage(object sender, PrintPageEventArgs e)
{
Rectangle pagearea = e.PageBounds;
e.Graphics.DrawImage(MemoryImage, (panel1.Width/2) - (this.panel1.Width/2), this.panel1.Location.Y);
}
請讓我知道如何提前解決這個
感謝
你在兩個窗口得到這個XP以及Windows 7? 可能是用戶訪問控制問題 – 2013-04-05 07:28:41
這與您的代碼沒有任何關係,它是您計算機上的配置問題。嘗試使用另一臺打印機來本地化問題,並要求您的LAN管理員或IT人員尋求幫助。 – 2013-04-05 10:47:45