[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Forms' (#lcl)

# TWindowMagnetManager.SnapToSides

Performs actions needed to resize or reposition a form to another form or an edge on the screen.

## Declaration

Source position: forms.pp line 444

`protected function TWindowMagnetManager.SnapToSides(`
`var x: Integer;`
`var cx: Integer;`
`px: Integer;`
`pcx: Integer;`
`pxout: Integer;`
`pcxout: Integer;`
`dist: Integer;`
`leftsides: TIntegerDynArray;`
`rightsides: TIntegerDynArray`
`):Boolean;`

## Description

Parameters passed to the method are variable arguments, and may be updated in the method to reflect the new position or size for the window when snapping behavior is applied.

On the Windows platform the Desktop Window Manager API is called to adjust the dimensions for the form instance using the shadow offsets returned by the Compositor. For other platforms (which do not lie about the size of the form instance), this step is not needed.

SnapToSides is used to implement the SnapToMonitor and SnapToForms methods in the class.