Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

resize and center Window


This topic is 7419 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

How can I center a window on the screen when it opens? Is there a calculation I can use or a script I can run that can figure the size of the screen the user is using and the Move/Resize Window appropriately?

Posted

Use the New Window script step with these parameters for Top and Left:

( Get ( ScreenHeight ) - Get ( WindowHeight ) ) /2

( Get ( ScreenWidth ) - Get ( WindowWidth ) ) /2

Posted

It can be a bit more complicated than that. Do you want the window centred on the screen, or centered in the middle of the users desktop (taking into account OS menu position and size etc)?

Posted

Using Get(WindowDesktopHeight) and Get(WindowDesktopWidth) accounts for task bars - whether it's on the left, right, bottom or top and whether it is one or two rows. If you want a full window according to the space available remember to -2 px from left and right sides, ie, Get(WindowDesktopWidth)-2. If you set it the same size, it'll force the scroll to appear.

I can only speak for Windows however. But this works well.

This topic is 7419 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.