Jump to content
Sign in to follow this  
mattsshwaryn

How do I vertically and horizontally center gui buttons and labels?

Recommended Posts

mattsshwaryn

I have a gui button menu that I use at work using autoit that replaces explorer on startup. In Windows 10 there is no wallpaper without explorer so I want to make the gui fullscreen which I'm able to do but how do I center vertically and horizontally my gui content such as buttons and labels. I also want to be able to add computer info in the bottom right corner which I know how to get the info but not how to place in the bottom right corner. Appreciate any help. Thanks!

Share this post


Link to post
Share on other sites
JLogan3o13

@mattsshwaryn welcome to the forum. You will get a lot more help if you provide the code for your GUI, rather than asking us to guess ;)

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
mattsshwaryn
4 minutes ago, JLogan3o13 said:

@mattsshwaryn welcome to the forum. You will get a lot more help if you provide the code for your GUI, rather than asking us to guess ;)

 

Thanks for the advice! Mostly just looking for general info.

Share this post


Link to post
Share on other sites
JLogan3o13

Ok, generally speaking, it depends....

  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites
spudw2k

Sounds like some basic geometry is what you need.  How does one find the center of an object?  Measure the sides/dimensions and find the mid-points (very easy for a rectangle/desktop).  

Solve for X & Y

Solve for X.png

edit: Center point coordinate [X,Y] = [(Shape W/2)+Shape X , (Shape H/2)+Shape Y]

Edited by spudw2k
  • Like 1

Share this post


Link to post
Share on other sites

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
Sign in to follow this  

×