graphics.stringwidth from OpenPrinterDialog(ps)?

When I use the folowing code

  Dim page As Graphics
  // Use Printer Settings
  page = OpenPrinterDialog(ps)

the page Graphicsobject doesn’t contain the StringWidth function.

When I used the following code

  dim p as picture
  dim g as graphics
  dim d as double

  p=new picture(1,1)
  g=p.graphics
  g.textsize=12

  d =  g. stringwidth("Hello World")

the page graphics object contains the stringwidth function.

Does the OpenPrinterDialog returns another kind of graphic object?

Not sure what you are or are not seeing but it works perfectly for me

  dim page as graphics
  page=OpenPrinterDialog()
  dim x as integer=page.StringWidth("S")

Stringwidth is a function which returns a value.

If you just type page. and hope that the autocomplete will show string width, it does not

You would have to hint that you want functions, by typing

d = page.

Thanks,

[quote=178235:@Jeff Tullin]Stringwidth is a function which returns a value.

If you just type page. and hope that the autocomplete will show string width, it does not
[/quote]

I have forgotten that.