I found something useful on this forum, but the .Width and .Height I get from the container window (see code below) are not ready to use.

- Code: Select all Expand viewCollapse view
`Dim a As Integer, b As Integer`

a = ThisComponent.getCurrentController.getFrame.ContainerWindow.PosSize.Width

b = ThisComponent.getCurrentController.getFrame.ContainerWindow.PosSize.Height

In fact, when I assign this values to the Height and Width property of a dialog (see code below), I get an over-sized window.

- Code: Select all Expand viewCollapse view
`Dim oDialog As Object`

DialogLibraries.LoadLibrary("Standard")

oDialog = CreateUnoDialog(DialogLibraries.Standard.MyDialog1)

oDialog.getModel.PositionX = 0

oDialog .getModel.PositionY = 0

oDialog.Model.Width = a

oDialog.Model.Height = b

I manually adjusted this (by errors and trials) and found that dividing these measures by a certain constant I get what I need on my screen:

- Code: Select all Expand viewCollapse view
`oDialog.Model.Width = a / 2.054`

oDialog.Model.Height = b / 1.883

I'm wondering why: are these properties (ContainerWindow.PosSize.Width vs oDialog.Model.Width) expressed in terms of different units of measurement? Is the container windows actually larger than I suppose (i.e. than the screen)? Why are the two coefficients (for width 2.054 and for height 1.883) different from each other?

Ultimately, is there a better and cleaner way to write "dialog, get the dimensions of the screen"?

Thanks in advance,

Davide