Jump to content
Sign in to follow this  
r2dak

Making my program Appear in middle of the screen

Recommended Posts

r2dak

hi every one sorry for this stupid question I've just finished my first autoit program which is working properly

the only problem is that whenever i run my program it appear near to top right corner, first i thought that it will happen only on my computer, but when i tried it on other computers it appeared on the same location as mine how can i make it appear in middle of the screen

PS: Sorry for my bad english

Edited by r2dak

[center][font=comic sans ms,cursive]PEACE & LOVE[/font][/center]

Share this post


Link to post
Share on other sites
telmob

try something like this:

$Formwidth = 280

$Formheight = 168

$Form = GUICreate("GUI", 280, 168, @DesktopWidth/2 - $Formwidth/2, @DesktopHeight/2 - $Formheight/2)

Edited by telmob
  • Like 1

Share this post


Link to post
Share on other sites
r2dak
WOW thanks Polymath it worked :thumbsup: Edited by r2dak

[center][font=comic sans ms,cursive]PEACE & LOVE[/font][/center]

Share this post


Link to post
Share on other sites
telmob

ahahah, you're welcome. but my name is Telmo :D

  • Like 1

Share this post


Link to post
Share on other sites
hannes08

Or:

$Form = GUICreate("GUI", 280, 168, -1, -1)
  • Like 2

Regards,Hannes[spoiler]If you can't convince them, confuse them![/spoiler]

Share this post


Link to post
Share on other sites
r2dak

ahahah, you're welcome. but my name is Telmo :D

:D Thank you Telmo

Or:

$Form = GUICreate("GUI", 280, 168, -1, -1)

thank you this is much more simpler Edited by r2dak

[center][font=comic sans ms,cursive]PEACE & LOVE[/font][/center]

Share this post


Link to post
Share on other sites
JLogan3o13

r2dak, this is where reading the help file really comes in handy. If you look at the help file section for GuiCreate, you'll see that the left and top parameters are optional. If you want a GUI to appear in the middle of the screen, just don't define them. So, this:

$Form = GUICreate("GUI", 280, 168, -1, -1)

Is the same as this:

$Form = GUICreate("GUI", 280, 168)

Hope that makes more sense to you :)

Edited by JLogan3o13

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

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  

×