Cloudsx Posted February 21, 2006 Share Posted February 21, 2006 (edited) i made a Guicreate but in the Guicreate i want to place a button that is also work but here is the problemif i press the button then there must come another Guicreat how can i make something like thatthis i my scriptCode#include <GUIConstants.au3>GUICreate("game",350,400); will create a dialog box that when displayed is centeredGUISetState (@SW_SHOW); will display an empty dialog boxOpt("GUICoordMode",3)GUICtrlCreateButton("gebouwen",290,100,60)GUISetState ();this wil create a buttonWhile 1$msg = GUIGetMsg()If $msg = $GUI_EVENT_CLOSE Then Exit Wend Edited February 21, 2006 by Cloudsx Link to comment Share on other sites More sharing options...
rudika Posted February 21, 2006 Share Posted February 21, 2006 i made a Guicreate but in the Guicreate i want to place a button that is also work but here is the problem if i press the button then there must come another Guicreat how can i make something like that this i my script Code #include <GUIConstants.au3> GUICreate("game",350,400); will create a dialog box that when displayed is centered GUISetState (@SW_SHOW); will display an empty dialog box Opt("GUICoordMode",3) $gebouwen = GUICtrlCreateButton("gebouwen",290,100,60) GUISetState ();this wil create a button While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit if $msg = $gebouwen Then GUICreate("gebouwen",200,200) Wend moin, moin...! i think you should use a function for the second GUI, look at my suggest. #include <GUIConstants.au3> GUICreate("game",350,400); will create a dialog box that when displayed is centered GUISetState (@SW_SHOW); will display an empty dialog box Opt("GUICoordMode",3) $gebouwen = GUICtrlCreateButton("gebouwen",290,100,60) GUISetState ();this wil create a button While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit if $msg = $gebouwen Then GUI2Create() Wend Func GUI2Create() GUICreate("gebouwen",200,200) GUISetState (@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit Wend EndFunc [font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font] Link to comment Share on other sites More sharing options...
Valuater Posted February 21, 2006 Share Posted February 21, 2006 i may be wrong here but i never suggest creating a GUI in the function... especially when this script has just started i always suggest creating the Gui(s) then set the state to "SHOW" when a button is pushed i have seen too many here creating GUIs in a loop and having many problems 8) Link to comment Share on other sites More sharing options...
Cloudsx Posted February 21, 2006 Author Share Posted February 21, 2006 can i also make a gui3create Link to comment Share on other sites More sharing options...
Valuater Posted February 21, 2006 Share Posted February 21, 2006 how to handle 10 childrenhttp://www.autoitscript.com/forum/index.ph...st=0&p=115370all you need to do is put in the buttons and labels8) Link to comment Share on other sites More sharing options...
Cloudsx Posted February 21, 2006 Author Share Posted February 21, 2006 (edited) and how about this how can i use more Guicreate in this #include <GUIConstants.au3> GUICreate("game",350,400); will create a dialog box that when displayed is centered GUISetState (@SW_SHOW); will display an empty dialog box Opt("GUICoordMode",4) $gebouwen = GUICtrlCreateButton("gebouwen",290,100,60) GUICtrlCreateButton("militair",290,125,60) GUICtrlCreateButton("onderzoek",290,150,60) GUICtrlCreateButton("verdediging",290,175,61) GUICtrlCreateButton("overzicht",290,200,60) GUISetState ();this wil create a button While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit if $msg = $gebouwen Then GUI2Create() Wend Func GUI2Create() GUICreate("gebouwen",350,350) GUISetState (@SW_SHOW) While 1 $smg = GUIGetMsg() If $smg = $GUI_EVENT_CLOSE then Exit WEnd EndFunc Edited February 21, 2006 by Cloudsx Link to comment Share on other sites More sharing options...
Valuater Posted February 21, 2006 Share Posted February 21, 2006 yes.. up to 1024 windows 8) Link to comment Share on other sites More sharing options...
Cloudsx Posted February 21, 2006 Author Share Posted February 21, 2006 but how do i make it i dont come out of that puzzle Link to comment Share on other sites More sharing options...
rudika Posted February 21, 2006 Share Posted February 21, 2006 and how about this how can i use more Guicreate in this#include <GUIConstants.au3>GUICreate("game",350,400); will create a dialog box that when displayed is centeredGUISetState (@SW_SHOW); will display an empty dialog boxOpt("GUICoordMode",4)$gebouwen = GUICtrlCreateButton("gebouwen",290,100,60)GUICtrlCreateButton("militair",290,125,60)GUICtrlCreateButton("onderzoek",290,150,60)GUICtrlCreateButton("verdediging",290,175,61)GUICtrlCreateButton("overzicht",290,200,60) GUISetState ();this wil create a buttonWhile 1$msg = GUIGetMsg()If $msg = $GUI_EVENT_CLOSE Then Exitif $msg = $gebouwen Then GUI2Create() WendFunc GUI2Create()GUICreate("gebouwen",350,350)GUISetState (@SW_SHOW)While 1$smg = GUIGetMsg()If $smg = $GUI_EVENT_CLOSE then ExitWEndEndFuncby every action you could create one more GUI, but if you want to make more button it is better to use Select Case EndSelect [font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font] Link to comment Share on other sites More sharing options...
Valuater Posted February 21, 2006 Share Posted February 21, 2006 #include <GUIConstants.au3> GUICreate("game",350,400, 200, 100); will create a dialog box that when displayed is centered GUISetState (@SW_SHOW); will display an empty dialog box Opt("GUICoordMode",4) GUICreate("game2",350,400); will create a dialog box that when displayed is centered $gebouwen = GUICtrlCreateButton("gebouwen",290,100,60) GUICtrlCreateButton("militair",290,125,60) GUICtrlCreateButton("onderzoek",290,150,60) GUICtrlCreateButton("verdediging",290,175,61) GUICtrlCreateButton("overzicht",290,200,60) GUISetState ();this wil create a button While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit if $msg = $gebouwen Then GUI2Create() Wend Func GUI2Create() GUICreate("gebouwen",350,350, 400, 200) GUISetState (@SW_SHOW) While 1 $smg = GUIGetMsg() If $smg = $GUI_EVENT_CLOSE then Exit WEnd EndFunc 8) Link to comment Share on other sites More sharing options...
Cloudsx Posted February 21, 2006 Author Share Posted February 21, 2006 how does it work with Select Case EndSelect could you show me please Link to comment Share on other sites More sharing options...
rudika Posted February 21, 2006 Share Posted February 21, 2006 how does it work with Select Case EndSelect could you show me pleaseWhile 1 $msg = GUIGetMsg() Case $msg = $gebouwen1 statement1 Case $msg = $gebouwen2 statement2 Case $msg = $gebouwen3 statement3 . . . Case $msg = $GUI_EVENT_CLOSE Exit Wendplease use the help file [font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font] Link to comment Share on other sites More sharing options...
rudika Posted February 21, 2006 Share Posted February 21, 2006 While 1 $msg = GUIGetMsg() Select Case $msg = $gebouwen1 statement1 Case $msg = $gebouwen2 statement2 Case $msg = $gebouwen3 statement3 . . . Case $msg = $GUI_EVENT_CLOSE Exit EndSelect Wendplease use the help file sorry, I forgott it with select [font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font] Link to comment Share on other sites More sharing options...
Cloudsx Posted February 21, 2006 Author Share Posted February 21, 2006 (edited) i want to have more Guicreate in this for the buttons CODE#include <GUIConstants.au3>GUICreate("game",350,400); will create a dialog box that when displayed is centeredGUISetState (@SW_SHOW); will display an empty dialog boxOpt("GUICoordMode",4)$gebouwen = GUICtrlCreateButton("gebouwen",290,100,60)GUICtrlCreateButton("militair",290,125,60)GUICtrlCreateButton("onderzoek",290,150,60)GUICtrlCreateButton("verdediging",290,175,61)GUICtrlCreateButton("overzicht",290,200,60) GUISetState ();this wil create a buttonWhile 1$msg = GUIGetMsg()If $msg = $GUI_EVENT_CLOSE Then Exitif $msg = $gebouwen Then GUI2Create() WendFunc GUI2Create()GUICreate("gebouwen",350,350)GUISetState (@SW_SHOW)While 1$smg = GUIGetMsg()If $smg = $GUI_EVENT_CLOSE then ExitWEndEndFunc Edited February 21, 2006 by Cloudsx Link to comment Share on other sites More sharing options...
Valuater Posted February 21, 2006 Share Posted February 21, 2006 your not trying... you try we help 8) Link to comment Share on other sites More sharing options...
Cloudsx Posted February 21, 2006 Author Share Posted February 21, 2006 but can i use this more time than once because then i go use that more and if that can not then i have to use the select thing Func GUI2Create() GUICreate("gebouwen",350,350) GUISetState (@SW_SHOW) Link to comment Share on other sites More sharing options...
Valuater Posted February 21, 2006 Share Posted February 21, 2006 Func GUI2Create() GUICreate("gebouwen2",350,350) GUISetState (@SW_SHOW) EndFunc Func GUI3Create() GUICreate("gebouwen3",350,350) GUISetState (@SW_SHOW) EndFunc Func GUI4Create() GUICreate("gebouwen4",350,350) GUISetState (@SW_SHOW) EndFunc 8) Link to comment Share on other sites More sharing options...
Cloudsx Posted February 21, 2006 Author Share Posted February 21, 2006 thank you sir Link to comment Share on other sites More sharing options...
Cloudsx Posted February 21, 2006 Author Share Posted February 21, 2006 but now i have some problem with the exit here is the example i have 2 dialogs child 1 and child 2 if i press on the button in child 1 then child 2 opens but if i want to close the child 2 on the big red X in the upper right corner then it will close both of the childs how can i turn that of Link to comment Share on other sites More sharing options...
Valuater Posted February 21, 2006 Share Posted February 21, 2006 show me what you got so far 8) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now