Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Customize PrintDialog Window in WPF

In my WPF application, I am going to print the contents of my ListBox. I want to add a new control to the PrintDialog box to select the number of lines (items) to print.

Is it possible to customize the existing PrintDialog box and add a new control to bind to ListBox.Count?

Or is there a better way to do this?

enter image description here

like image 331
Roshil K Avatar asked Mar 26 '13 14:03

Roshil K


2 Answers

It's actually possible to extend common dialogs with .NET. I found this article on MSDN. However, I'm not sure whether this also applies to the print dialog or whether it can still be done, but I suggest you read that first.

like image 143
Thorsten Dittmar Avatar answered Nov 19 '22 10:11

Thorsten Dittmar


"C# provides a standard PrintDialog which has all the basic print dialog functionality. Since it is declared as a sealed class, there is no way to extend it through C# native syntax."

Please see the following link: http://www.codeproject.com/Articles/16797/Extending-C-PrintDialog-Part-I

You can always create your own "Printing dialog screen" from scratch , then you can add your drop down with the ammount of lines to print(dropdown) witch you then get from the listbox(concatenating or build string) and send to a specified printer.

like image 39
Renier Avatar answered Nov 19 '22 11:11

Renier