Sign in to follow this  
Followers 0
mattsshwaryn

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

5 posts in this topic

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



@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
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

Ok, generally speaking, it depends....

1 person likes this

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

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

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
1 person likes this

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  
Followers 0