Window.Bounds

From Xojo Documentation

Property (As Realbasic.Rect )
aWindow.Bounds = newRealbasic.RectValue
or
Realbasic.RectValue = aWindow.Bounds

Supported for all project types and targets.

Use this property to Get/Set the true bounds of a window (i.e. including frame/title decorations).

Notes

On Linux the Left/Top bounds exclude the decorations due to the way window decorations are handled there.

Examples

To get the bounds:

Dim winBounds As Realbasic.Rect
winBounds = Self.Bounds
MsgBox("Left = " + Str(winBounds.Left))

To set the bounds, do not modify the Bounds properly directly. This does not work because you will be modifying a temporary object. Instead set the bounds in your own Realbasic.Rect instance and assign that to bounds:

Dim myBounds As New Realbasic.Rect
myBounds.Left = 100
myBounds.Top = 100
myBounds.Height = Self.Height
myBounds.Width = Self.Width
Self.Bounds = myBounds