jackyyll Posted April 1, 2006 Share Posted April 1, 2006 Alright i have a disabled combobox ($uploadmirror) and i want to enable it when the Enable checkbox is checked ($enbau is hte checkbox) .. so i try this code... While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case GUICtrlRead($enbau) = $GUI_CHECKED While GUICtrlRead($enbau) = $GUI_CHECKED GUISetState($uploadmirror, $GUI_ENABLE) WEnd Case GUICtrlRead($enbau) = $GUI_UNCHECKED GUISetState($uploadmirror, $GUI_DISABLE) EndSelect WEnd Exit No luck.. i always have trouble with check boxes :/ Any help? Link to comment Share on other sites More sharing options...
Valuater Posted April 1, 2006 Share Posted April 1, 2006 i usually set these type of actions outside the case/select While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect If GUICtrlRead($enbau) = $GUI_CHECKED Then GUISetState($uploadmirror, $GUI_ENABLE) Else GUISetState($uploadmirror, $GUI_DISABLE) EndIf WEnd Exit *** not tested 8) Link to comment Share on other sites More sharing options...
jackyyll Posted April 1, 2006 Author Share Posted April 1, 2006 Doesnt seem to work :/ I think there might be a problem with the $GUI_ENABLE command? Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 1, 2006 Moderators Share Posted April 1, 2006 (edited) Edited for the reason of NOT READING THE POSTED CODE............. Edited April 1, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Valuater Posted April 1, 2006 Share Posted April 1, 2006 (edited) Doesnt seem to work :/ I think there might be a problem with the $GUI_ENABLE command? i did not pay enough attention to your control commands... its guictrlsetstate... not guisetstate While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect If GUICtrlRead($enbau) = $GUI_CHECKED Then GUICtrlSetState($uploadmirror, $GUI_ENABLE) Else GUICtrlSetState($uploadmirror, $GUI_DISABLE) EndIf WEnd Exit 8) ... i thought SmOke would catch that right away also Edited April 1, 2006 by Valuater Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted April 1, 2006 Moderators Share Posted April 1, 2006 I didn't look at it at all... that's why I didn't catch it, I would have given this example#include <guiconstants.au3> $main = GUICreate('main', 200, 100) $combo = GUICtrlCreateCombo('', 10, 10, 180, 100) $button = GUICtrlCreateButton('ENABLE/DISABLE', 50, 45, 100, 30) $check = 1 GUICtrlSetData($combo, 'TEST|TEST2') GUISetState() While 1 $Msg = GUIGetMsg() If $Msg = - 3 Then Exit If $Msg = $button Then If $check = 1 Then GUICtrlSetState($combo, $GUI_DISABLE) $check = 2 ElseIf $check = 2 Then GUICtrlSetState($combo, $GUI_ENABLE) $check = 1 EndIf EndIf WEndIf I had... I thought he was using $CBS_DROPDOWNLIST ( me) Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Valuater Posted April 1, 2006 Share Posted April 1, 2006 this may be better than i previously posted, as it is not "polling" all the time While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $enbau If GUICtrlRead($enbau) = $GUI_CHECKED Then GUICtrlSetState($uploadmirror, $GUI_ENABLE) Else GUICtrlSetState($uploadmirror, $GUI_DISABLE) EndIf EndSelect WEnd Exit 8) Link to comment Share on other sites More sharing options...
jackyyll Posted April 1, 2006 Author Share Posted April 1, 2006 Yay, that last one you posted works great Thanks Link to comment Share on other sites More sharing options...
Valuater Posted April 1, 2006 Share Posted April 1, 2006 Welcome 8) 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