0

In my C# WinForm application, I use a "PrintDialog" to open a standard Window where the user can "customize" his print request (select the printer, access the properties, select to print all pages or a range, ...)

.Net Print Dialog

But in that window, the user cannot enter a list of pages (separated by ,) that he want to print, just as we can do within notepad's Print Dialog.

Notepad' print dialog

Any idea how I can get a Print Dialog like the notepad's PrintDialog ?

[EDIT] As suggested by Brian, the solution is to set the property UseEXDialog to true on PrintDialog. That was not obvious based on the documentation, but it does the trick !

4
  • 1
    Did you set this to true? msdn.microsoft.com/en-us/library/…
    – Brian
    Jul 2, 2014 at 7:53
  • You are repeatedly mentioning Notepad, but what you are showing is WordPad. Jul 2, 2014 at 8:02
  • Thanks a lot Brian!!! This property does the trick. I did read the documentation but didn't try all the properties... And the documentation for that one only says : true to indicate the dialog should be shown with the Windows XP style, otherwise false. Which was not IMO clearly related to that field... Jul 3, 2014 at 19:55
  • Sorry O.R., I did my test with notepad but took the screenshots from this link yevol.com/en/vcsharp2005/controls/dlgprint.htm (I didn't know I could upload my own screenshots so easily on StackOverflow and wanted to redirect to existing ones). It's the same print dialog for both applciation... Jul 3, 2014 at 19:59

2 Answers 2

2

Set PrintDialog.UseEXDialog to true.

http://msdn.microsoft.com/en-us/library/system.windows.forms.printdialog.useexdialog(v=vs.110).aspx

1
  • Although the documentation of Microsoft is really not explicit, this property does indeed the trick... Thanks a lot again Brian. Jul 7, 2014 at 10:24
0

Based on the documentation, it seems that you should set the AllowSomePages property to true.

Gets or sets a value indicating whether the Pages option button is enabled.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.