[Gambas-user] It is possible to print without having to show the system's config form?

Martin Belmonte mbelmonte at belmotek.net
Wed Mar 9 10:51:10 CET 2022


El 8/3/22 a las 17:20, martin p cristia escribió:
> My program has its own print setup form, so the printer's name, paper 
> size and page settings are all set into the instanciated Printer object, 
> say printer1. There is no need for the .Configure method, so its not 
> called; but it shows anyway after printer1.Print method. Is there a way 
> to prevent this?
Taking the program from the farm called Printing_example (by cogier), it 
is possible to observe that there is a call to the .Configure method and 
it makes the form appear, which you don't want to happen. Well if you 
comment that line you will see that the form does not appear and the 
printout comes out directly from the default printer.

Public Sub ButtonPrint_Click()

   ' commenting the line below results in direct printing by printer 
without the configuration form appearing.

   'If PrinterOne.Configure() Then Return
   PrinterOne.Print
End

Public Sub PrinterOne_Draw()
   Paint.DrawText(TextArea1.Text, 10, 10)
End

Regards.
Martín.


More information about the User mailing list