Sign in to follow this  
Followers 0
r2dak

Making my program Appear in middle of the screen

7 posts in this topic

#1 ·  Posted (edited)

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



#2 ·  Posted (edited)

try something like this:

$Formwidth = 280

$Formheight = 168

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

Edited by telmob
1 person likes this

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

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

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

1 person likes this

Share this post


Link to post
Share on other sites

Or:

$Form = GUICreate("GUI", 280, 168, -1, -1)
2 people like this

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

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

#7 ·  Posted (edited)

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