Jump to content

Need help opening another GUI depending on the checked RadioButton


Joshuaaaa
 Share

Recommended Posts

I've got my main GUI here, which contains 4 radio buttons in which will eventually open a seperate GUI depending on which one is checked:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("CoBrother 1.0", 201, 241, 207, 128)
GUISetIcon("C:\Documents and Settings\Mom\Desktop\New Folder\cofriend.ico")
GUISetBkColor(0xFFFFE1)
$Archer = GUICtrlCreateRadio("Archer", 24, 40, 113, 17)
$Taoist = GUICtrlCreateRadio("Taoist", 24, 72, 113, 17)
$Trojan = GUICtrlCreateRadio("Trojan", 24, 104, 113, 17)
$Warrior = GUICtrlCreateRadio("Warrior", 24, 136, 113, 17)
$Select = GUICtrlCreateButton("Select", 56, 192, 75, 25, 0)
$Class = GUICtrlCreateGroup("Class", 8, 16, 185, 161)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

And here is the GUI in which I want to open if "Archer" is selected

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("CoBrother 1.0", 201, 251, 207, 128)
GUISetIcon("C:\Documents and Settings\Mom\Desktop\New Folder\cofriend.ico")
GUISetBkColor(0xFFFFE1)
$Auto_scatter = GUICtrlCreateCheckbox("Auto_scatter", 32, 136, 97, 17)
$Left_click_jump = GUICtrlCreateCheckbox("Left_click_jump", 32, 176, 97, 17)
$Other = GUICtrlCreateGroup("Other", 8, 112, 185, 105)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$TG = GUICtrlCreateGroup("TG", 8, 8, 185, 105)
$Scatter_and_bow = GUICtrlCreateRadio("Scatter_and_bow", 32, 32, 113, 17)
$Intensify_leveler = GUICtrlCreateRadio("Intensify_leveler", 32, 72, 113, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Class_Select = GUICtrlCreateButton("Class_Select", 16, 224, 80, 25, 0)
$Run = GUICtrlCreateButton("Run", 104, 224, 80, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

How would I do this?

Link to comment
Share on other sites

....

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("CoBrother 1.0", 201, 241, 207, 128)
GUISetIcon("C:\Documents and Settings\Mom\Desktop\New Folder\cofriend.ico")
GUISetBkColor(0xFFFFE1)
$Archer = GUICtrlCreateRadio("Archer", 24, 40, 113, 17)
$Taoist = GUICtrlCreateRadio("Taoist", 24, 72, 113, 17)
$Trojan = GUICtrlCreateRadio("Trojan", 24, 104, 113, 17)
$Warrior = GUICtrlCreateRadio("Warrior", 24, 136, 113, 17)
$Select = GUICtrlCreateButton("Select", 56, 192, 75, 25, 0)
$Class = GUICtrlCreateGroup("Class", 8, 16, 185, 161)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Select
            If _IsChecked($Archer) Then Runner()
    EndSwitch
WEnd

Func Runner()
    
    GUISetState( @SW_HIDE, $Form1) 
    
    #include <GUIConstants.au3>
    #Region ### START Koda GUI section ### Form=
    $Form2 = GUICreate("CoBrother 1.0", 201, 251, 207, 128)
    GUISetIcon("C:\Documents and Settings\Mom\Desktop\New Folder\cofriend.ico")
    GUISetBkColor(0xFFFFE1)
    $Auto_scatter = GUICtrlCreateCheckbox("Auto_scatter", 32, 136, 97, 17)
    $Left_click_jump = GUICtrlCreateCheckbox("Left_click_jump", 32, 176, 97, 17)
    $Other = GUICtrlCreateGroup("Other", 8, 112, 185, 105)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $TG = GUICtrlCreateGroup("TG", 8, 8, 185, 105)
    $Scatter_and_bow = GUICtrlCreateRadio("Scatter_and_bow", 32, 32, 113, 17)
    $Intensify_leveler = GUICtrlCreateRadio("Intensify_leveler", 32, 72, 113, 17)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $Class_Select = GUICtrlCreateButton("Class_Select", 16, 224, 80, 25, 0)
    $Run = GUICtrlCreateButton("Run", 104, 224, 80, 25, 0)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
        $nMsg = GUIGetMsg()
        Switch $nMsg
            Case $GUI_EVENT_CLOSE
                ExitLoop
        EndSwitch
    WEnd
    
    GUIDelete($Form2)
    GUISetState( @SW_SHOW, $Form1)
    
EndFunc   ;==>Runner

Func _IsChecked($control)
    Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED
EndFunc

8)

NEWHeader1.png

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...