如何使用打印对话框 [英] How can I use the Print Dialog

查看:149
本文介绍了如何使用打印对话框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果您在Visual Studio 2005中去以下(或只是做CTRL + P):
档==>打印..

If you go in Visual Studio 2005 to the following (or just do ctrl+p): File ==> Print..

您得到打印对话框屏幕。我想在我的程序是相同的,但如何?

You get a print dialog screen. I want the same in my program, but how?

推荐答案

此对话框是一个所谓的通用对话框的,一个内置的,可以通过多个应用程序使用Windows对话框。

This dialog box is a so-called common dialog, a built-in Windows dialog that can be used by multiple applications.

要在你的C#应用​​程序使用此对话框,您可以使用 PrintDialog类类。下面的MSDN页面包含的描述,以及一些示例代码:

To use this dialog box in your C# application, you can use the PrintDialog class. The following MSDN pages contains descriptions as well as some sample code:


  • 的WinForms:的 System.Windows.Forms.PrintDialog

  • WPF:<一HREF =http://msdn.microsoft.com/en-us/library/system.windows.controls.printdialog.aspx相对=nofollow> System.Windows.Controls.PrintDialog (感谢< A HREF =http://stackoverflow.com/questions/8051623/how-can-i-use-the-print-dialog/8051660#8051660>巴尔托什)

  • WinForms: System.Windows.Forms.PrintDialog
  • WPF: System.Windows.Controls.PrintDialog (thanks to Bartosz)

这篇关于如何使用打印对话框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆