killaz219 Posted September 22, 2004 Posted September 22, 2004 (edited) Hello, I am having a problem from switching from one gui window to another. Now i know this should be possible but i think im doing it wrong. Heres an example code ;Script generated by AutoBuilder 0.4 Opt("GUICoordMode", 1) Opt("GUINotifyMode", 1) GuiCreate("MyGUI", 392,266,(@DesktopWidth-392)/2, (@DesktopHeight-266)/2 , 0x04CF0000) $button_1 = GUISetControl("button", "Next Gui", 60, 70, 290, 50) GuiShow() While 1 sleep(100) $msg = GuiMsg(0) Select Case $msg = -3 Exit Case $msg = 1 ;;; Case $msg = $button_1 NextGui () EndSelect WEnd Func NextGui () GuiDelete() GuiCreate("MyGUI", 392,266,(@DesktopWidth-392)/2, (@DesktopHeight-266)/2 , 0x04CF0000) $button_2 = GuiSetControl ("Button", "Exit", 60, 70, 290, 50) GuiShow() While 1 Select Case $msg = $button_2 Exit EndSelect Wend EndFunc Help would be appreciated Edited September 22, 2004 by killaz219
CyberSlug Posted September 22, 2004 Posted September 22, 2004 You would need to add the following line in the Func NextGui() between the "While 1" and "Select":$msg = GuiMsg(0)Depending on what you want to accomplish, I would not recommend calling NextGui() from within the original While 1 loop...... The following *might* be better in some cases:Opt("GUINotifyMode", 1) GuiCreate("MyGUI", 392,266,(@DesktopWidth-392)/2, (@DesktopHeight-266)/2 , 0x04CF0000) $button_1 = GUISetControl("button", "Next Gui", 60, 70, 290, 50) GuiShow() While 1 sleep(100) $msg = GuiMsg(0) Select Case $msg = -3 Exit Case $msg = $button_1 ExitLoop EndSelect WEnd ; Next GUI: GuiDelete() GuiCreate("MyGUI", 392,266,(@DesktopWidth-392)/2, (@DesktopHeight-266)/2 , 0x04CF0000) $button_2 = GuiSetControl ("Button", "Exit", 60, 70, 290, 50) GuiShow() While 1 $msg = GuiMsg(0) Select Case $msg = $button_2 Exit EndSelect Wend Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig!
killaz219 Posted September 23, 2004 Author Posted September 23, 2004 Thanks a lot, i should've been able to do that O well, I'm just glad support on this forum is top notch
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