Jump to content

Center a GUI


Hawkwing
 Share

Recommended Posts

Simple question, when you create a child GUI, how do you center it over it's parent?

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
Share on other sites

But then if you can move the parent gui around, then it will put the child gui where the parent started, not where it is now.

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
Share on other sites

So handle the parent WM_MOVE event. You can also check, if the child may not exist always, if $hChild is pointing to an existing window handle, If IsHWnd($hChild) Then move the window.

Edit Maybe using MDI is the proper way to go?

Edited by Authenticity
Link to comment
Share on other sites

Thanks, I'm not really sure how handle the parent wm_move event, but when I put $WS_EX_MDICHILD in the exStyle section, it worked.

The Wheel of Time turns, and Ages come and pass, leaving memories that become legend. Legend fades to myth, and even myth is long forgotten when the Age that gave it birth comes again.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...