Rex Posted October 10, 2005 Share Posted October 10, 2005 Hi i'm trying to create a gui with one main gui and some childs, with a back and a next button. My problem is i can't finde out how to get the script to keep switch to the next child when a user cliks next expandcollapse popup#include <GuiConstants.au3> $Main = GuiCreate("MyGUI", 516, 323,(@DesktopWidth-516)/2, (@DesktopHeight-323)/2) $Button_1 = GuiCtrlCreateButton("&Next >", 330, 290, 80, 25) $Button_2 = GuiCtrlCreateButton("< &Back", 250, 290, 80, 25) $Button_3 = GuiCtrlCreateButton("&Exit", 420, 290, 80, 25) $Button_6 = GuiCtrlCreateButton("", 10, 270, 490, 3,-1, $WS_EX_STATICEDGE) GuiSetState() $Child_1 = GuiCreate("", 506, 238,0, 0, BitOr($WS_CHILD,$WS_TABSTOP)+$WS_DLGFRAME ,-1, $main) $Label_1 = GuiCtrlCreateLabel("Child 1", 20, 20, 230, 30) GuiSetState() $Child_2 = GuiCreate("", 506, 238,0, 0, BitOr($WS_CHILD,$WS_TABSTOP)+$WS_DLGFRAME ,-1, $main) $Label_1 = GuiCtrlCreateLabel("Child 2.", 30, 40, 290, 30) GuiSetState(@SW_HIDE) $Child_3 = GuiCreate("", 506, 238,0, 0, BitOr($WS_CHILD,$WS_TABSTOP)+$WS_DLGFRAME ,-1, $main) $Label_1 = GuiCtrlCreateLabel("Child 3.", 30, 40, 290, 30) GuiSetState(@SW_HIDE) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 GUISetState(@SW_HIDE, $child_1) GUISetState(@SW_SHOW, $child_2) ;;; EndSelect WEnd Please can some one help me with this little problem Link to comment Share on other sites More sharing options...
B3TA_SCR1PT3R Posted October 10, 2005 Share Posted October 10, 2005 wenever i make more than 1 gui i always put em in seperate functions so i dont have to deal with all that child crap and different messages [right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right] Link to comment Share on other sites More sharing options...
Rex Posted October 10, 2005 Author Share Posted October 10, 2005 wenever i make more than 1 gui i always put em in seperate functions so i dont have to deal with all that child crap and different messagesBut then you don't get the same cool function as you can with childs Link to comment Share on other sites More sharing options...
Valuater Posted October 10, 2005 Share Posted October 10, 2005 here ya go expandcollapse popup#include <GuiConstants.au3> Dim $show = 0 $Main = GuiCreate("MyGUI", 516, 323,(@DesktopWidth-516)/2, (@DesktopHeight-323)/2) $Button_1 = GuiCtrlCreateButton("&Next >", 330, 290, 80, 25) $Button_2 = GuiCtrlCreateButton("< &Back", 250, 290, 80, 25) $Button_3 = GuiCtrlCreateButton("&Exit", 420, 290, 80, 25) $Button_6 = GuiCtrlCreateButton("", 10, 270, 490, 3,-1, $WS_EX_STATICEDGE) GuiSetState() $Child_1 = GuiCreate("", 506, 238,0, 0, BitOr($WS_CHILD,$WS_TABSTOP)+$WS_DLGFRAME ,-1, $main) $Label_1 = GuiCtrlCreateLabel("Child 1", 20, 20, 230, 30) GuiSetState() $Child_2 = GuiCreate("", 506, 238,0, 0, BitOr($WS_CHILD,$WS_TABSTOP)+$WS_DLGFRAME ,-1, $main) $Label_1 = GuiCtrlCreateLabel("Child 2.", 30, 40, 290, 30) GuiSetState(@SW_HIDE) $Child_3 = GuiCreate("", 506, 238,0, 0, BitOr($WS_CHILD,$WS_TABSTOP)+$WS_DLGFRAME ,-1, $main) $Label_1 = GuiCtrlCreateLabel("Child 3.", 30, 40, 290, 30) GuiSetState(@SW_HIDE) While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $Button_1 Set_Show() ;;; EndSelect WEnd ;--------- Functions ------------------- Func Set_Show() If $Show = 0 Then GUISetState(@SW_HIDE, $child_1) GUISetState(@SW_SHOW, $child_2) $Show = 1 Return EndIf If $Show = 1 Then GUISetState(@SW_SHOW, $child_1) GUISetState(@SW_HIDE, $child_2) $Show = 0 Return EndIf EndFunc 8) Link to comment Share on other sites More sharing options...
B3TA_SCR1PT3R Posted October 10, 2005 Share Posted October 10, 2005 But then you don't get the same cool function as you can with childs there are no cool functions just abunch of confusion [right][font="Courier New"]...Run these streets all day, I can sleep when I die.[/font] [/right] Link to comment Share on other sites More sharing options...
Rex Posted October 10, 2005 Author Share Posted October 10, 2005 here ya goCase $msg = $Button_1 Set_Show() ;;; EndSelect WEnd ;--------- Functions ------------------- Func Set_Show() If $Show = 0 Then GUISetState(@SW_HIDE, $child_1) GUISetState(@SW_SHOW, $child_2) $Show = 1 Return EndIf If $Show = 1 Then GUISetState(@SW_SHOW, $child_1) GUISetState(@SW_HIDE, $child_2) $Show = 0 Return EndIf EndFunc8)thxwhy oh why did't i think of that It so simpelI was begining to mess around with add one, or array'er som thing like that Link to comment Share on other sites More sharing options...
Valuater Posted October 10, 2005 Share Posted October 10, 2005 Actually i am looking at a similar situation... use child windows or place each gui in a function or #include each gui or use tabs or ???but after looking at your idea.. i completed the task with 10 child windows including the "Next" and "Back" buttons... you can see it herehttp://www.autoitscript.com/forum/index.php?showtopic=16769#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