Jump to content
Sign in to follow this  
lucarim

GUI Help

Recommended Posts

lucarim

I am trying to create a drop box that depending on which you choose it does something different. Any help is appreciated. Thanks

The code I have now is below.

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Sophos()

Func Sophos()

Local $msg, $Install, $List

GUICreate("Sophos Installs",300,100)

GUICtrlCreateLabel("Choose Sophos To Install...", 10, 10)

$List = GUICtrlCreateCombo("DO", 50, 50)

GUICtrlSetData(-1, "BES|ECM|FES|FMS|FHS|MHS|MSE|PAX|SWHS|VRB|WCDC|WDE|WMS|WHS", "DO")

$Install = GUICtrlCreateButton("Install",200, 50, 50, 20)

GUISetState()

Do

$msg = GUIGetMsg()

If $msg = $Install Then

MsgBox(0, "Selected School", GUICtrlRead($List))

EndIf

Until $msg = $GUI_EVENT_CLOSE

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

WEnd

EndFunc

Share this post


Link to post
Share on other sites
Authenticity

#include <GUIConstantsEx.au3>

Opt('MustDeclareVars', 1)

Sophos()

Func Sophos()
    Local $msg, $Install, $List

    GUICreate("Sophos Installs", 300, 100)

    GUICtrlCreateLabel("Choose Sophos To Install...", 10, 10)

    $List = GUICtrlCreateCombo("DO", 50, 50)
    GUICtrlSetData(-1, "BES|ECM|FES|FMS|FHS|MHS|MSE|PAX|SWHS|VRB|WCDC|WDE|WMS|WHS", "DO")

    $Install = GUICtrlCreateButton("Install", 200, 50, 50, 20)

    GUISetState()

    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                ExitLoop
                
            Case $Install
                Switch GUICtrlRead($List)
                    Case "DO"
                        ; DO
                    Case "BES"
                        ; BES
                    Case "ECM"
                        ; ETC...
                    Case "FES"
                    Case "FMS"
                    Case "FHS"
                    Case "MHS"
                    Case "MSE"
                    Case "PAX"
                    Case "SWHS"
                    Case "VRB"
                    Case "WCDC"
                    Case "WDE"
                    Case "WMS"
                    Case Else ; WHS
                        
                EndSwitch
                
        EndSwitch
    WEnd
    
    GUIDelete()
    Exit
EndFunc   ;==>Sophos

Within each case you can call different functions or do different tasks.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.