MrVietA2 Posted November 19, 2011 Share Posted November 19, 2011 Hello everyone !I have a problem with my program :#include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("AutoIT", 182, 140, 505, 284) $Combo1 = GUICtrlCreateCombo("1", 16, 40, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$WS_VSCROLL, $CBS_DROPDOWNLIST)) GUICtrlSetData(-1,"2|Other") $Label1 = GUICtrlCreateLabel("Combo", 16, 16, 37, 17) $Label2 = GUICtrlCreateLabel("Input", 16, 80, 28, 17) $Input = GUICtrlCreateInput("", 16, 104, 145, 21) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $Combo1 Switch Guictrlread($Combo1) Case "1" GUICtrlSetData($Input,"1000") Case "2" GUICtrlSetData($Input,"2000") Case "Other" GUICtrlSetData($Input,"3000") EndSwitch EndSwitch WEndI would like when I choose Combo "1" or Combo "2" then make $Input to Read-Only, but when I choose Combo "3" then make $Input can be edit ! How can I do it ? Please help me !Thanks ! Link to comment Share on other sites More sharing options...
bogQ Posted November 19, 2011 Share Posted November 19, 2011 (edited) GUISetState(@SW_SHOW) GUICtrlSetState($Input, $GUI_DISABLE) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $Combo1 Switch Guictrlread($Combo1) Case "1" GUICtrlSetData($Input,"1000") GUICtrlSetState($Input, $GUI_DISABLE) Case "2" GUICtrlSetData($Input,"2000") GUICtrlSetState($Input, $GUI_DISABLE) Case "Other" GUICtrlSetState($Input, $GUI_ENABLE) GUICtrlSetData($Input,"3000") EndSwitch EndSwitch WEnd Edited November 19, 2011 by bogQ MrVietA2 1 TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
MrVietA2 Posted November 19, 2011 Author Share Posted November 19, 2011 Hi bogQ ! Thanks for example, but I need somethings like Internet Download Manager ( Internet Download Manager configuration) :Can I do it ? Thanks ! Link to comment Share on other sites More sharing options...
bogQ Posted November 19, 2011 Share Posted November 19, 2011 (edited) i do not have that download manager so i assume that your looking for something like this #include <ComboConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("AutoIT", 182, 140, 505, 284) $Combo1 = GUICtrlCreateCombo("1", 16, 40, 145, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL,$WS_VSCROLL, $CBS_DROPDOWNLIST)) GUICtrlSetData(-1,"2|Other") $Label1 = GUICtrlCreateLabel("Combo", 16, 16, 37, 17) $Label2 = GUICtrlCreateLabel("Input", 16, 80, 28, 17) $Input = GUICtrlCreateInput("", 16, 104, 145, 21,$ES_NUMBER) GUISetState(@SW_SHOW) $clast = 1 Dim $speed[3] = [1000,2000,3000] While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $Combo1 Switch Guictrlread($Combo1) Case "1" GUICtrlSetData($Input,$speed[0]) $clast = 1 Case "2" GUICtrlSetData($Input,$speed[1]) $clast = 2 Case "Other" GUICtrlSetData($Input,$speed[2]) $clast = "Other" EndSwitch EndSwitch If $clast <> "Other" And $speed[$clast] <> GUICtrlRead($Input) Then GUICtrlSetData($Input,$speed[$clast]) WEnd Edited November 19, 2011 by bogQ MrVietA2 1 TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
MrVietA2 Posted November 19, 2011 Author Share Posted November 19, 2011 Thanks bogQ ! Link to comment Share on other sites More sharing options...
MrVietA2 Posted November 19, 2011 Author Share Posted November 19, 2011 (edited) Oh,sorry ! I have a question about Input :Can I do it for GuictrlcreateInput ? I don't want to use $ES_READONLY but I like bogQ's way. Thanks !#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("AutoIT", 275, 82, 409, 202) GUICtrlCreateInput("", 16, 16, 241, 21) ;<--- here $Button1 = GUICtrlCreateButton("OK", 96, 48, 83, 25) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $Button1 Exit EndSwitch WEnd Edited November 19, 2011 by MrVietA2 Link to comment Share on other sites More sharing options...
MrVietA2 Posted November 21, 2011 Author Share Posted November 21, 2011 I need some help 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