Auto-resizing and centring forms on screen

Calling this procedure from the form’s OnActivate event will resize the form in proportion to the screen resolution once the form height and width has been calculated it can then be centred.
Note – form should be set to autoresize and AutoScroll := False at least while being re-calculated. Also the font size for the form should be (probably) 12 for the font to be resized downwards for 800×600 – all controls should be set to ParentFont := True so they will resize.
While this works exactly for the old screen resolutions which were all more or less in proportion there is nothing which will resize screens properly for the newer stretched screens, eg. for 1280×960 and 1280×1024. The min ratio calculated is scrx / screenx = 1 so the form stays with original measurements.

This code refers to two functions: centreleft and centretop. These are defined as follows: