请MS支持及MVP 解答,是CommonDialog问题还是Win2k问题

Corny 2002-05-02 12:36:58
在VB6 中,用CommonDialog改变缺省打印机属性,设置PrinterDefault=True
Flags=cdlPDPrintSetup,并用ShowPrinter方法,按MSDN里说法,应该改变打印机的属性,包括纸张类型等。
但实际上使用时并不能改变,请问为什么?怎么解决(98时是正常的)

环境:Win2k SP2,VB6 SP5
...全文
61 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
Corny 2002-05-10
  • 打赏
  • 举报
回复
虽然这样可以解决Printer的几个属性,但与纸张相关的属性却无法获得,如paperSize等属性,都无法改变,参照MS网站上提供有API,也无法真正改变打印机的缺省属性,到底为什么呀?

另外,使用 Set Printer=...的方法甚至不能改变缺省的打印机,这VB还能不能在Win2k下工作呀
acptvb 2002-05-10
  • 打赏
  • 举报
回复
感谢您使用微软产品。

在Windows NT version 4.0, Windows 2000, or Windows XP平台下,在VB6.0中,调用CommonDialogbox的ShowPrint方法以后,Printer的一些属性例如Copies和Orientation不会改变,而在Windows 95, Windows 98, or Windows ME下工作正常,您可以通过以下方法来解决这个问题,如下例:
With CommonDialog1
.ShowPrinter
Printer.Copies = .Copies
Printer.Orientation = .Orientation
Debug.Print "Copies = " & CStr(Printer.Copies) & vbCrLf & "Orientation = " & CStr(Printer.Orientation)
End With

您可以参考以下文章了解更多信息:
PRB: CommonDialog Changes System Wide Printer Properties (Q198712)
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q198712

微软全球技术中心 VB技术支持
本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。

16,722

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧