Modal Print Dialog

SyntaxEditor for WPF Forum

Posted 10 years ago by Peter MacNeil
Version: 14.1.0601
Avatar

Hello,

I'm using the SyntaxEditor ShowPrintDialog method which is doing a very nice job. WPF Controls 2013.2 build 0591.

One item that is a bit of a bother is that the print dialog is not modal so the user is able to interact with the editor while the dialog is displayed.

I also tried the ShowPrintPreviewDialog which turns out to be modal but when the print button in that dialog is clicked the print dialog comes up and it is not modal.

Is there a feature or setting I am missing or other suggestion?

 

Thanks!

Comments (2)

Answer - Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Peter,

We basically use the standard WPF PrintDialog and call ShowDialog on it, which is supposed to open the dialog as modal.  There doesn't appear to be a way to set an "owner" window on the PrintDialog, but regardless, in our sample it appears to be modal when I open it.

For the ShowPrintPreviewDialog, that is a custom Window we made and we do set the owner on that.  Then the toolbar button code ends up calling the same PrintDialog like above.

I'm not sure that there is anything we can do on our end here since the PrintDialog is supposed to be modal by default, and it appears to be so on my system when I test.


Actipro Software Support

Posted 10 years ago by Peter MacNeil
Avatar

Hi,

Yes the SyntaxEditor code is good.

The problem is with the structure of my appllication. I am hosting the view containing the SyntaxEditor control within an HwndSource window because my application has a mixture of technologies. The HwndSource's parent is a MFC window. Microsoft's WPF PrintDialogs when called from the view or view model hosted in a MFC or WinForm parent windows don't find a WPF MainWindow because there isn't one so they end up modeless. If in my C# code I create a PrintDialog and call ShowDialog it is modeless too so it's definitely not a problem in the SyntaxEditor. The PrintDialog uses the class Win32PrintDialog. After lots of searching the web I've concluded that this can not be worked around for the PrintDialog. I might look into exporting RTF from a document snapshot and print it with MFC for now. Maybe later we'll convert our application to all WPF and we can use the editor's print functionality which I would greatly prefer.

 

Thanks for your help and fast responses!

Pete

The latest build of this product (v24.1.2) was released 2 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.