Alfonso72 Posted September 6, 2023 Share Posted September 6, 2023 hi all I should open the item selected in the combobox with a button, example: if I select the temp directory and then close, I would like to be able to reopen it with a button as well as with the combobox $sData = "|Local Temp|Win Temp|Windows Dir" $cCombo = GUICtrlCreateCombo("", 5, 5, 120, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE)) $BtnCombo = GUICtrlCreateButton("Open Dir", 5, 50, 100, 25) ;it does not work! Case $BtnCombo GUICtrlSetData($cCombo,$sData) ;it works very well Case $cCombo Switch GUICtrlRead($cCombo) Case "Local Temp" ShellExecute(@TempDir) Case "Win Temp" ShellExecute(@WindowsDir & "\Temp") Case "Windows" ShellExecute(@WindowsDir") EndSwitch Link to comment Share on other sites More sharing options...
Solution benners Posted September 6, 2023 Solution Share Posted September 6, 2023 Put the $BtnCombo on the same line as the $cCombo $sData = "|Local Temp|Win Temp|Windows Dir" $cCombo = GUICtrlCreateCombo("", 5, 5, 120, 25, BitOR($GUI_SS_DEFAULT_COMBO,$CBS_SIMPLE)) GUICtrlSetData(-1,$sData) $BtnCombo = GUICtrlCreateButton("Open Dir", 5, 50, 100, 25) ;it works very well Case $cCombo, $BtnCombo Switch GUICtrlRead($cCombo) Case "Local Temp" ShellExecute(@TempDir) Case "Win Temp" ShellExecute(@WindowsDir & "\Temp") Case "Windows" ShellExecute(@WindowsDir") EndSwitch Alfonso72 1 Link to comment Share on other sites More sharing options...
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