Sign in to follow this  
Followers 0

Call function on combo box selection?

3 posts in this topic

I have a very simple GUI which consists of a single combo box with 2 possible values. I would like to call a function when one and only one of these values is selected, but I can't get things to work correctly. I'm trying to work in steps to get to that point, but I'm getting stuck pretty early on. Here's what I have right now (I've stripped out code that is irrelevant to this problem):

Global $buCountDefault = "Specific";0
                Global $buCountGlobal = "Global";1
                GUICtrlCreateLabel("How many backups should be kept?", 10, 65, 200, 20)
                    If FileExists($buIniPath) Then
                        Local $buCountReadDefault = IniRead($buIniPath, "BackUp.Settings", "count", $sIniErrorMsg)
                        $buCountSetDefault = $buCountDefault
                    If FileExists($buIniPath) And $buCountReadDefault = 0 Then
                        $buCountSetDefault = $buCountDefault
                    If FileExists($buIniPath) And $buCountReadDefault = 1 Then
                        $buCountSetDefault = $buCountGlobal
                $sConfigComboCount = GUICtrlCreateCombo($buCountDefault, 10, 85)
                $buCountRead = GUICtrlRead($sConfigComboCount)
                GUISetState ()

                While 1
                    $sMsg = GUIGetMsg()
                        Case $sMsg = $GUI_EVENT_CLOSE Or $sMsg = $sCancel
                        Case $sMsg = $sConfigComboCount; I haven't added criteria here yet because I can't get the basics working
                            Msgbox(0, "", $buCountRead)

I'm using the MsgBox just for testing right now, and it always returns the default value of the combo box instead of the selection. Anyone know where I'm going wrong? Thanks a bunch.

Share this post

Link to post
Share on other sites

*smacks forehead*

Thank you.

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