alawoona Posted September 7, 2006 Share Posted September 7, 2006 (edited) I am writing a script with a complicated GUI. I have created some updown controls which the script disables and hides. Subsequently the script enables and shows the updown controls. When the latter happens the width of the updown control changes. See the simplified script below and the screencapture images.#include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $TEST = GUICreate("TEST", 255, 91, 197, 115) $Input1 = GUICtrlCreateInput("0", 26, 28, 36, 21) $Updown1 = GUICtrlCreateUpdown($Input1, BitOR($UDS_WRAP,$UDS_ALIGNRIGHT)) GUICtrlSetLimit($Updown1, 59, 0) $Hide = GUICtrlCreateButton("Hide", 87, 27, 53, 21, 0) $Show = GUICtrlCreateButton("Show", 162, 27, 53, 21, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Hide GUICtrlSetState ($Input1, $GUI_HIDE) GUICtrlSetState ($Input1, $GUI_DISABLE) GUICtrlSetState ($Updown1, $GUI_HIDE) GUICtrlSetState ($Updown1, $GUI_DISABLE) Case $Show GUICtrlSetState ($Input1, $GUI_ENABLE) GUICtrlSetState ($Input1, $GUI_SHOW) GUICtrlSetState ($Updown1, $GUI_ENABLE) GUICtrlSetState ($Updown1, $GUI_SHOW) EndSwitch WEndRun the script:Click Hide:Click Show and this is what happens to the Updown Control:Now click Show again: ????? Edited September 7, 2006 by alawoona Link to comment Share on other sites More sharing options...
BigDod Posted September 7, 2006 Share Posted September 7, 2006 (edited) It appears to work ok as long as you do not use the disable and enable functions. Edit - Another way that works #include <GUIConstants.au3> #Region ### START Koda GUI section ### Form= $TEST = GUICreate("TEST", 255, 91, 197, 115) $Input1 = GUICtrlCreateInput("0", 26, 28, 36, 21) $Updown1 = GUICtrlCreateUpdown($Input1, BitOR($UDS_WRAP,$UDS_ALIGNRIGHT)) GUICtrlSetLimit($Updown1, 59, 0) $Hide = GUICtrlCreateButton("Hide", 87, 27, 53, 21, 0) $Show = GUICtrlCreateButton("Show", 162, 27, 53, 21, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Hide GUICtrlSetState ($Input1, $GUI_DISABLE + $GUI_HIDE) GUICtrlSetState ($Updown1, $GUI_DISABLE + $GUI_HIDE) Case $Show GUICtrlSetState ($Input1, $GUI_ENABLE + $GUI_SHOW) GUICtrlSetState ($Updown1, $GUI_ENABLE + $GUI_SHOW) EndSwitch WEnd Edited September 7, 2006 by BigDod Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
alawoona Posted September 7, 2006 Author Share Posted September 7, 2006 (edited) Thanx BigDod - that does work so I will be pragmatic and use what works. Edited September 7, 2006 by alawoona 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