Jump to content

Gui to Gui


killaz219
 Share

Recommended Posts

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
Link to comment
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!
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...