[Gambas-user] Using Printer.Default returns an error.

T Lee Davidson t.lee.davidson at gmail.com
Fri May 1 19:26:07 CEST 2020


On 5/1/20 1:44 AM, Ian Roper wrote:
> 
> Printer.Default (gb.qt4)
> 
> Static Property Read Default As String
> 
> Return the name of the default printer.
> 
> 
> If I try to assign this value to a valid text field it returns the error message "/printer.default is static/"
> 
> Is the help for printer.default wrong?
> 
> 
> Cheers,
> 
> Ian.

You didn't show how you are trying to use the method. You cannot use it on a Printer object. You must use it statically.

Public Sub Form_Open()

   Dim sDefaultPrinter As String

   sDefaultPrinter = Printer.Default
   Print sDefaultPrinter

End



-- 
Lee


More information about the User mailing list