AnsweredAssumed Answered

Always centre the window

Question asked by user2147901 on Jul 3, 2018
Latest reply on Jul 3, 2018 by user2147901

Hi, i am working on a script that centers the window(only one). I have do some research on the community and found a script which is shown as follow.


Set variable [$sh ; Get (ScreenHeight)]

Set variable [$sw ; Get (ScreenWidth)]

Set variable [$wh ; Get (WindowHeight)]

Set variable [$ww ; Get (WindowWidth)]

Move/Resize window [current window ; Top: ($sh - $wh)/2 ; Left : ($sw - $ww)/2]

Adjust Window[Resize to Fit]


i have followed this suggestion and set up a script trigger on layout enter on each layout created. However, for some layouts which are small in width and height could not center properly. I think i have to modify the script, but i don't have any idea.


I am using filemaker 15