Sign in to follow this  
Followers 0
killaz219

Gui to Gui

3 posts in this topic

#1 ·  Posted (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 by killaz219

Share this post


Link to post
Share on other sites



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!

Share this post


Link to post
Share on other sites

Thanks a lot, i should've been able to do that :ph34r:

O well, I'm just glad support on this forum is top notch

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