VPE.SetupPrinter() does not disable the window

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

VPE.SetupPrinter() does not disable the window

Postby ds-hanau » Fri Jul 07, 2017 3:47 pm

Hi IdealSoftware Team

I read your FAQ entry "VPE.SetupPrinter() does not disable the window (viewtopic.php?f=2&t=89&p=229&hilit=SetupPrinter#p229) and still have a question.
I have a simple demo project with one form and one button. the button click performs just these 3 lines of code:

Code: Select all
this.Enabled = false;
vpeControl.SetupPrinter("", PrintDialogControl.Always);
this.Enabled = true;


In this example I solved the problem that the setupdialog hides when clicking the form again.
But I still have the issue when clicking in the besides in the back of my sample application where maybe excel is opened, the setupdialog gets lost.
When clicking on the taskbar coming back to my sample application I can see my form but the setupdialog is still behind my excel applcation.

I need to open the setupdialog as modaldialog (ShowDialog) to solve this issue.

This code makes it more the way Im looking for:

Code: Select all
var dlg = new System.Windows.Forms.PrintDialog();
dlg.ShowDialog();


Any solution?
Thanks
Andrej
ds-hanau
 
Posts: 16
Joined: Tue Jun 30, 2015 1:56 pm

Re: VPE.SetupPrinter() does not disable the window

Postby IDEAL Software Support » Tue Jul 11, 2017 4:19 pm

If you run vpedemo.exe, which comes with the VPE installation and is a native Windows program, you will notice that everything works as it should. This means when the printer setup dialog is shown, VPE makes it modal to the preview window. If the VPE preview is an external window this causes expected behaviour. If the preview is embedded into a window of your framework, you need to find yourself a way to emulate a modal window. VPE can not make any other windows modal, or disable them, since this might affect the whole logic of your application.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: VPE.SetupPrinter() does not disable the window

Postby ds-hanau » Wed Jul 12, 2017 11:50 am

Hi

Just to be sure: I do not have any preview windows.

My sample is just having one form with a pushbutton and the click event just calls Vpe.SetupPrinter(...).
The issue is that the printersetupdialog is not modal.
How can I open the Vpe.SetupPrinter(...) dialog in a modal way?

Thanks for your reply
Andrej
ds-hanau
 
Posts: 16
Joined: Tue Jun 30, 2015 1:56 pm

Re: VPE.SetupPrinter() does not disable the window

Postby IDEAL Software Support » Wed Jul 12, 2017 8:53 pm

You have a preview window. It is external and invisible. Therefore, what I wrote before, still holds true.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: VPE.SetupPrinter() does not disable the window

Postby ds-hanau » Tue Jul 18, 2017 9:15 am

Sorry, I think I still did not get it?
What kind of preview window do you mean?
I do not know the scenes behind the function call of "VPE.SetupPrinter()", if you open a invisible window or not.
In my code snippet I just call "VPE.SetupPrinter()" and nothing else.

So is it possible to open the modal setup printer dialog in a modal way?
How can I demonstrate my issue? Can I send you my sample code?

Thanks for your support
Andrej
ds-hanau
 
Posts: 16
Joined: Tue Jun 30, 2015 1:56 pm

Re: VPE.SetupPrinter() does not disable the window

Postby IDEAL Software Support » Tue Jul 18, 2017 9:34 am

When you call OpenDoc() VPE creates an external invisible preview window. Except if you specify that VPE's preview should be embedded. In this case VPE creates an embedded invisible preview window. If you use the external preview window, the printer dialog is modal to this window, but of course not to other windows. You need to make your app's other windows behave modal yourself.
IDEAL Software Support
 
Posts: 1633
Joined: Thu Nov 18, 2004 4:03 pm

Re: VPE.SetupPrinter() does not disable the window

Postby DarwinHol » Thu Oct 19, 2017 5:06 pm

IDEAL Software Support wrote:When you give these fat burners for women a shot and call OpenDoc() VPE creates an external invisible preview window. Except if you specify that VPE's preview should be embedded. In this case VPE creates an embedded invisible preview window. If you use the external preview window, the printer dialog is modal to this window, but of course not to other windows. You need to make your app's other windows behave modal yourself.


Thanks for the clarification. I've had the same issue but this explains it.
DarwinHol
 
Posts: 1
Joined: Sat Oct 07, 2017 10:53 am


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 9 guests