Jump to content

GUIctrlsetdata and combo box help .


Recommended Posts

hi,

this is my code:

#include <Array.au3>
#include <File.au3>
#include <GUIconstants.au3>

GUICreate ("change VDN Var",300,300,100,100)
GUICtrlCreateCombo ("Choose VDN",10,10)
GUICtrlSetData (-1,"17001|17002|17993")
GUISetState ()

While 1
    $msg = GUIGetMsg()
    
    If $msg = $GUI_EVENT_CLOSE Then ExitLoop
Wend

now, I need to know who to make something happen like "msgbox" if the user choose VDN 17001, and if he choose 17002 to display something else, without including a "submit" button, but automatically, meaning if the user opened the combo and choose 17002 a msgbox imidiatly apear saying you choose 17002.

Thanks,

Link to comment
Share on other sites

well, this does what I need but it does not give time for the user to make the choosing he wants.

#include <Array.au3>
#include <File.au3>
#include <GUIconstants.au3>

GUICreate("change VDN Var", 300, 300, 100, 100)
$M = GUICtrlCreateCombo("Choose VDN", 10, 10)
GUICtrlSetData(-1, "17001|17002|17993")
GUISetState()

While 1
    sleep (500)
    $s = GUICtrlRead($M)
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
        Case $s = "17001"
            MsgBox(0, "17001", "")
        Case $s = "17002"
            MsgBox(0, "17002", "")
        Case $s = "17993"
            MsgBox(0, "17993", "")
    EndSelect
    
WEnd

anyone?

Link to comment
Share on other sites

erezlevi

Don`t use a Sleep() function in loop with GUIGetMsg() function.

Example:

GUICreate("change VDN Var", 300, 300, 100, 100)

$M = GUICtrlCreateCombo("Choose VDN", 10, 10)
GUICtrlSetData(-1, "17001|17002|17993")

GUISetState()

While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = -3
            ExitLoop
        Case $msg = $M
            $read = GUICtrlRead($M)
            MsgBox(0, "", $read)
    EndSelect
WEnd
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...