Board index » delphi » TPrintSetupDialog not showing up

TPrintSetupDialog not showing up

Hi all

I have a TPrintSetupDialog on a form. In the form is also a TComboBox
letting the user select one of the installed printers.
Printer.PrinterIndex is set in the OnChange handler of the combo box.

A button brings up the print setup dialog for the selected printer. BUT:
if a printer which is not ready is chosen, the dialog is not showing up!
I don't even get an error message or exception. Why is that? If I choose
the same printer from within the dialog, everything works fine! Any
ideas?

Thanks

Erik Ronst?rm

 

Re:TPrintSetupDialog not showing up


Quote
In article <3C4ADB7D.61FE6...@ompom.com>, Erik Ronstr?m wrote:
> I have a TPrintSetupDialog on a form. In the form is also a TComboBox
> letting the user select one of the installed printers.
> Printer.PrinterIndex is set in the OnChange handler of the combo box.

> A button brings up the print setup dialog for the selected printer. BUT:
> if a printer which is not ready is chosen, the dialog is not showing up!
> I don't even get an error message or exception. Why is that? If I choose
> the same printer from within the dialog, everything works fine! Any
> ideas?

You may want to call this procedure before you execute the dialog:

// Posted by Steve Schafer

 procedure ResetPrinter;
   var
     Device, Driver, Port: array[0..80] of Char;
     DevMode: THandle;
   begin
   Printer.GetPrinter(Device, Driver, Port, DevMode);
   Printer.SetPrinter(Device, Driver, Port, 0)
   end;

--
Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be

Other Threads