Sign in to follow this  
Followers 0
Swift

This Doesnt Switch GUI's?

3 posts in this topic

why doesnt this work? pressing next should @SW_HIDE that one...then @SW_SHOW the other one...not working...

#include <GUIConstants.au3>
$Form1 = GUICreate("Form 1", 416, 235, 192, 145)
GUISetBkColor(0x0000FF)
$Button2 = GUICtrlCreateButton("Next", 304, 200, 89, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Button3 = GUICtrlCreateButton("Back", 216, 200, 81, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Label1 = GUICtrlCreateLabel("                   File Installer.", 16, 8, 387, 33)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFFFF00)
GUICtrlSetCursor (-1, 2)
$Input1 = GUICtrlCreateInput("Choose Folder With All Programs", 16, 48, 289, 21)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Button4 = GUICtrlCreateButton("Browse...", 320, 48, 81, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
GUICtrlSetCursor (-1, 2)
$Button1 = GUICtrlCreateButton("Homepage", 14, 200, 97, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
GUISetState(@SW_SHOW)
$Form2 = GUICreate("Form2", 416, 235, 192, 145)
GUISetBkColor(0x0000FF)
$Form2Label1 = GUICtrlCreateLabel("                File Installer.", 16, 8, 383, 33)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFFFF00)
$Form2Checkbox1 = GUICtrlCreateCheckbox("Create A Start Menu Folder", 16, 56, 145, 17)
$Form2Checkbox2 = GUICtrlCreateCheckbox("Create A Program Files Folder", 16, 80, 161, 17)
$Form2Input1 = GUICtrlCreateInput("Start Menu Name", 184, 56, 217, 21)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Form2Input2 = GUICtrlCreateInput("Program Files Name", 184, 80, 217, 21)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Form2Button1 = GUICtrlCreateButton("Homepage", 11, 199, 97, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Form2Button2 = GUICtrlCreateButton("Back", 176, 200, 97, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Form2Button3 = GUICtrlCreateButton("Next", 272, 200, 105, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
GUISetState(@SW_HIDE)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button2
            GUISetState($Form1, @SW_HIDE)
            GUISetState($Form2, @SW_SHOW)
        Case $Form2Button2
            GUISetState($Form2, @SW_HIDE)
            GUISetState($Form1, @SW_SHOW)
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites



#include <GUIConstants.au3>
$Form1 = GUICreate("Form 1", 416, 235, 192, 145)
GUISetBkColor(0x0000FF)
$Button2 = GUICtrlCreateButton("Next", 304, 200, 89, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Button3 = GUICtrlCreateButton("Back", 216, 200, 81, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Label1 = GUICtrlCreateLabel("                     File Installer.", 16, 8, 387, 33)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFFFF00)
GUICtrlSetCursor (-1, 2)
$Input1 = GUICtrlCreateInput("Choose Folder With All Programs", 16, 48, 289, 21)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Button4 = GUICtrlCreateButton("Browse...", 320, 48, 81, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
GUICtrlSetCursor (-1, 2)
$Button1 = GUICtrlCreateButton("Homepage", 14, 200, 97, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
GUISetState(@SW_SHOW)
$Form2 = GUICreate("Form2", 416, 235, 192, 145)
GUISetBkColor(0x0000FF)
$Form2Label1 = GUICtrlCreateLabel("                   File Installer.", 16, 8, 383, 33)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFFFF00)
$Form2Checkbox1 = GUICtrlCreateCheckbox("Create A Start Menu Folder", 16, 56, 145, 17)
$Form2Checkbox2 = GUICtrlCreateCheckbox("Create A Program Files Folder", 16, 80, 161, 17)
$Form2Input1 = GUICtrlCreateInput("Start Menu Name", 184, 56, 217, 21)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Form2Input2 = GUICtrlCreateInput("Program Files Name", 184, 80, 217, 21)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Form2Button1 = GUICtrlCreateButton("Homepage", 11, 199, 97, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Form2Button2 = GUICtrlCreateButton("Back", 176, 200, 97, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
$Form2Button3 = GUICtrlCreateButton("Next", 272, 200, 105, 25, 0)
GUICtrlSetBkColor(-1, 0xFFFF00)
GUISetState(@SW_HIDE)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button2
            GUISetState(@SW_HIDE,$Form1)
            GUISetState(@SW_SHOW,$Form2)
        Case $Form2Button2
            GUISetState(@SW_HIDE,$Form2)
            GUISetState(@SW_SHOW,$Form1)
    EndSwitch
WEnd



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Omg...:) @ myself...Wow...how couldnt I see that?

GUISetState was wrong >< Thanks BigDod :)

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