AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GUI button

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
ljose



Joined: 11 Sep 2009
Posts: 7

PostPosted: Tue Feb 16, 2010 6:21 am    Post subject: GUI button Reply with quote

Hi,

Here is small script that creates a GUI window with a 'DONE' button. I would like the user to click on 'DONE' to exit the GUI.

But the GUI doesn't seem to be working normally. The button does not appear in the GUI.
Code:

Gui, Font, S10 CDefault Bold, Verdana
Gui, Add, Text, x36 y20 w390 h40 +Center, Text1
Gui, Add, Text, x36 y70 w390 h20 +Center, Text2
Gui, Add, Text, x36 y100 w390 h60 +Center, Text3
Gui, 9:Add, Button, x176 y180 w100 h30 +Center vext_doneu gext_doneu, Done
Gui, Show, w477 h226,

ext_doneu:
   Gui, 9: Destroy
Return

_________________
Leo
http://www.einfochips.com
Back to top
View user's profile Send private message
porrasnick



Joined: 30 Jan 2010
Posts: 166

PostPosted: Tue Feb 16, 2010 6:33 am    Post subject: Reply with quote

Code:
Gui, Font, S10 CDefault Bold, Verdana
Gui, Add, Text, x36 y20 w390 h40 +Center, Text1
Gui, Add, Text, x36 y70 w390 h20 +Center, Text2
Gui, Add, Text, x36 y100 w390 h60 +Center, Text3
Gui, Show, w477 h226,
Gui, 9:Add, Button, x176 y180 w100 h30 +Center vext_doneu gext_doneu, Done
Gui, 9:Show
Return

ext_doneu:
  Gui, 9: Destroy
Return
Back to top
View user's profile Send private message
jballi



Joined: 01 Oct 2005
Posts: 748
Location: Texas, USA

PostPosted: Tue Feb 16, 2010 6:43 am    Post subject: Reply with quote

Not quite. Your code is actually creating two windows. GUI 1 (the default) and GUI 9. Either add 9: to all of the GUI statements or get rid of of the 9: from the two statements. Something like this:

Code:
Gui, Font, S10 CDefault Bold, Verdana
Gui, Add, Text, x36 y20 w390 h40 +Center, Text1
Gui, Add, Text, x36 y70 w390 h20 +Center, Text2
Gui, Add, Text, x36 y100 w390 h60 +Center, Text3
Gui, Add, Button, x176 y180 w100 h30 +Center vext_doneu gext_doneu, Done
Gui, Show, w477 h226,
return

ext_doneu:
   Gui Destroy
   ExitApp
Return

I hope this helps.
Back to top
View user's profile Send private message Send e-mail
porrasnick



Joined: 30 Jan 2010
Posts: 166

PostPosted: Tue Feb 16, 2010 6:47 am    Post subject: Reply with quote

i figured that's what he wanted, since he added the Gui, 9:... command in there in the first place
Back to top
View user's profile Send private message
ljose



Joined: 11 Sep 2009
Posts: 7

PostPosted: Tue Feb 16, 2010 9:39 am    Post subject: Reply with quote

aha! thanks you guys
_________________
Leo
http://www.einfochips.com
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group