当前位置:编程学习 > C#/ASP.NET >>

xp下wpf打印框出现乱码

wpf调用系统打印,打印部分源码如下

PrintDialog pDialog = new PrintDialog();
pDialog.PageRangeSelection = PageRangeSelection.AllPages;
pDialog.UserPageRangeEnabled = true;
if (pDialog.ShowDialog()==true)
{
    using (XpsDocument xpsDocument = new XpsDocument(printDocFile, FileAccess.ReadWrite))
    {
        FixedDocumentSequence fixedDocSeq = xpsDocument.GetFixedDocumentSequence();
        pDialog.PrintDocument(fixedDocSeq.DocumentPaginator, "证书打印");
    }
}

现象:
1.win7/8都不出问题。
2.xp下第一次打印没问题,第二次就会出现打印框乱码。
3.出问题的时候,影响了输入法(搜狗输入法).
第一次

第二次

第二次错误导致输入法的乱码


请问各位如何解决这个问题,小弟谢了先。 --------------------编程问答-------------------- http://technet.microsoft.com/zh-cn/magazine/system.windows.controls.printdialog.showdialog(VS.90).aspx

先去掉using试试看。可能XP和Win7/8的.NET版本差异吧 --------------------编程问答--------------------
引用 1 楼 mengfeiX 的回复:
http://technet.microsoft.com/zh-cn/magazine/system.windows.controls.printdialog.showdialog(VS.90).aspx

先去掉using试试看。可能XP和Win7/8的.NET版本差异吧


去点using还是错,话说去不去掉应该没得影响吧。
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,