HiSoftDev Posted September 29, 2008 Posted September 29, 2008 script will read a reg key and if it found they key there then it will disable the checkbox. can anyone tell me how to disable checkbox? thanks. #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $GUI = GUICreate(\"Test\", 133, 105, 254, 220) $C1 = GUICtrlCreateCheckbox(\"Choice 1\", 32, 16, 97, 17) $C2 = GUICtrlCreateCheckbox(\"Choice 2\", 32, 41, 97, 15) $B1 = GUICtrlCreateButton(\"Button1\", 24, 72, 75, 25, 0) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $C1 GUICtrlRead($C1) = ; another code EndSwitch WEnd
bluelamp Posted September 29, 2008 Posted September 29, 2008 GUICtrlSetState ( controlID, $GUI_DISABLE) should do it
HiSoftDev Posted September 29, 2008 Author Posted September 29, 2008 i want to disable check box only (Not the text with it) can id do it?
dbzfanatic Posted September 29, 2008 Posted September 29, 2008 You could change the background to grey/white/your GUI's BG color after it's disabled to make it seem like the text is still active and even if it's disabled you should still be able to change the text within your code so that should be all you need. Go to my website. | My Zazzle Page (custom products)Al Bhed Translator | Direct linkScreenRec ProSimple Text Editor (STE) [TUTORIAL]Task Scheduler UDF <--- First ever UDF!_ControlPaste() UDF[quote name='renanzin' post='584064' date='Sep 26 2008, 07:00 AM']whats help ?[/quote]
ChromeFan Posted September 29, 2008 Posted September 29, 2008 you can create Labels with your checkBox and remove the text with CheckBox. Website: www.cerescode.comForum: www.forum.cerescode.comIRC: irc.freenode.net , Channel: #Ceres--------------------Autoit Wrappers, Great additions to your script (Must See) (By: Valuater)Read It Befor Asking Question Click Here...--------------------Join Monoceres's Forums http://www.monoceres.se--------------------There are three kinds of people: Those who make things happen, those who watch things happen, and those who ask, What happened? Casey Stengel
Zedna Posted September 29, 2008 Posted September 29, 2008 #include <ButtonConstants.au3>#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $GUI = GUICreate("\Test\", 133, 105, 254, 220) $C1 = GUICtrlCreateCheckbox("\Choice 1\", 32, 16, 97, 17) $C2 = GUICtrlCreateCheckbox("\Choice 2\", 32, 41, 97, 15) $B1 = GUICtrlCreateButton("\Button1\", 24, 72, 75, 25, 0) $reg_value = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Your Company Name\Your software Name", "YourValue") If @error Then GUICtrlSetState($C1, $GUI_DISABLE) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $B1 If IsChecked($C1) Then ; ... ; another code EndSwitch WEnd Func IsChecked($control) Return BitAnd(GUICtrlRead($control),$GUI_CHECKED) = $GUI_CHECKED EndFunc Resources UDF ResourcesEx UDF AutoIt Forum Search
rasim Posted September 29, 2008 Posted September 29, 2008 i want to disable check box only (Not the text with it) can id do it? #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $GUI = GUICreate("Test", 133, 105, 254, 220) GUICtrlCreateLabel("Choice 1", 50, 16, 50, 16) $C1 = GUICtrlCreateCheckbox("", 32, 16, 15, 16) GUICtrlCreateLabel("Choice 1", 50, 41, 50, 16) $C2 = GUICtrlCreateCheckbox("Choice 2", 32, 41, 15, 16) $B1 = GUICtrlCreateButton("Disable", 24, 72, 75, 25, 0) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg() Switch $Msg Case $GUI_EVENT_CLOSE Exit Case $B1 If GUICtrlRead($B1) = "Disable" Then GUICtrlSetState($C1, $GUI_DISABLE) GUICtrlSetState($C2, $GUI_DISABLE) GUICtrlSetData($B1, "Enable") Else GUICtrlSetState($C1, $GUI_ENABLE) GUICtrlSetState($C2, $GUI_ENABLE) GUICtrlSetData($B1, "Disable") EndIf EndSwitch WEnd
HiSoftDev Posted September 29, 2008 Author Posted September 29, 2008 @ rasim hi friend, this is 3rd time you helped me. thanks a lot for your help and i will never forget it. thanks once again.
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