matthewst Posted July 19, 2006 Posted July 19, 2006 Here is what I have? expandcollapse popup#include <GUIConstants.au3> Opt("GUIResizeMode", 1) Opt("GUIOnEventMode", 1) $Gui = GUICreate("Bldg.", 215, 200, 192, 125, BitOR($WS_SIZEBOX, $WS_MINIMIZEBOX, $WS_CAPTION, $WS_POPUP, $WS_SYSMENU)) GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents") $Combo1 = GUICtrlCreateCombo("", 10, 10, 200, 240, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$WS_GROUP)) GUICtrlSetTip(-1, "Select the building with the emergency") GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Bldg 1|Bldg 2|Bldg 3|Bldg 4|Bldg 5") $Combo2 = GUICtrlCreateCombo("", 10, 40, 200, 240, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$WS_GROUP)) GUICtrlSetTip(-1, "Select the building with the emergency") GUICtrlSetFont(-1, 10, 400, 0, "Times New Roman") GUICtrlSetData(-1, "Bldg 1|Bldg 2|Bldg 3|Bldg 4|Bldg 5") $OK1 = GUICtrlCreateButton ("OK", 25, 70, 50) GUICtrlSetOnEvent(-1, "OKPressed") $Cancel1 = GUICtrlCreateButton ("Cancel", 140, 70, 60) GUICtrlSetOnEvent(-1, "CancelPressed") GUISetState(@SW_SHOW) $win_pos = WinGetPos($Gui) $tmp_pos = $win_pos While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else EndSelect Wend Func OKPressed() If $Combo1 = "Bldg 1" Then Run("pic.bat", "", @SW_HIDE) EndIF EndFunc Func CancelPressed() exit EndFunc Func SpecialEvents() Select Case @GUI_CTRLID = $GUI_EVENT_CLOSE Exit EndSelect EndFunc If I select bldg 1 in the first box and hit ok I want a picture of that building dislayed. How do I make it do that?
matthewst Posted July 19, 2006 Author Posted July 19, 2006 I've tried using case instead of if's but still no luck.
jvanegmond Posted July 19, 2006 Posted July 19, 2006 GUICtrlRead every time, when it changes you should.. I'll show a example: $Read = GUICtrlRead($Combo) If Not ($Previous = $Read) Then GUICtrlSetImage($PictureControl, @ScriptDir & "\" & $Read) $Previous = $Read EndIf github.com/jvanegmond
matthewst Posted July 19, 2006 Author Posted July 19, 2006 Sorry manadar, I just can't get that to work either.
matthewst Posted July 19, 2006 Author Posted July 19, 2006 GOT IT!!!!!!!!!!!!!!!! Thanks manadar!!!! Func OKPressed() $Read = GUICtrlRead($Combo1) If $Read = "Bldg 1" Then Run("pic.bat", "", @SW_HIDE) EndIf If $Read = "Bldg 2" Then Run("pic2.bat", "", @SW_HIDE) EndIf EndFunc
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now