Brian Dunning's FileMaker Custom Functions

getWindowCenter ( height ; width )

Get the top and left coordinates to center a window on the screen.

  Average rating: 5.0 (1 vote) Log in to vote

Josh Ormond   Josh Ormond - Show more from this author
Iozax, LLC
http://iozax.com

Share on Facebook Share on Twitter

  Sample input:
getWindowCenter ( 600 ; 800 )
  Sample output:
{"left":320,"top":115}

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

Get the top and left coordinates to center a window on the screen.

If you don't pass in the height or width, the function will use the current window's height and width to calculate the coordinates.

Also, if the input height or width is larger than the desktop dimensions, the function will return the desktop dimension instead.

There are 2 helper functions that will return just the left or top.

 

Comments

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: