themax90 Posted February 8, 2007 Posted February 8, 2007 (edited) For example: $GUI = GUICreate("GUI", 400, 400) $Edit = GUICtrlCreateEdit("Edit", 10, 10, 380, 380, $ES_READONLY) GUISetState(@SW_SHOW) What if I want to remove the $ES_READONLY from my edit box? How do I do this? Thanks. Smith P.S. Wow it's been a while since I've needed help. Just glad the communities here. Edit 1: I think I just reenter all the styles I had previously with GUICtrlSetStyle but still is there a more direct route? Edited February 8, 2007 by AutoIt Smith
Moderators SmOke_N Posted February 8, 2007 Moderators Posted February 8, 2007 $GUI = GUICreate("GUI", 400, 425) $Edit = GUICtrlCreateEdit("Edit", 10, 10, 380, 380) GUICtrlSendMsg($Edit, 0xCF, 1, 0) $Button = GUICtrlCreateButton('Undo', 10, 395, 380, 25) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case -3 Exit Case $Button GUICtrlSendMsg($Edit, 0xCF, 0, 0) MsgBox(64, 'Active', 'You can now edit the edit box') EndSwitch WEnd 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.
taz742 Posted March 31, 2008 Posted March 31, 2008 #include <GuiConstants.au3> #include <EditConstants.au3> $GUI = GUICreate("GUI", 400, 425) $Edit = GUICtrlCreateEdit("Edit", 10, 10, 380, 380, $ES_READONLY) $Button = GUICtrlCreateButton('Undo', 10, 395, 380, 25) GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case -3 Exit Case $Button Local $Current_Style = _GUICtrlGetStyle($Edit) If BitAND($Current_Style, $ES_READONLY) Then GUICtrlSetStyle($Edit, BitAND($Current_Style, BitNOT($ES_READONLY)), -1) GUICtrlSetData($Button,"Redo") MsgBox(64, 'Active', 'You can now edit the edit box') Else GUICtrlSetStyle($Edit, BitOR($Current_Style, $ES_READONLY), -1) GUICtrlSetData($Button,"Undo") MsgBox(64, 'Read Only', "You can't edit the edit box") EndIf EndSwitch WEnd Func _GUICtrlGetStyle($CtrlhWnd) If Not IsHWnd($CtrlhWnd) Then $CtrlhWnd = GUICtrlGetHandle($CtrlhWnd) Local $a_Style = DllCall("user32.dll", "long", "GetWindowLong", "hwnd", $CtrlhWnd, "int", -16);get existing Style Return $a_Style[0] EndFunc ;==>_GUICtrlGetStyleoÝ÷ Ù&¦z^«b¢w·¢w°ØDÅ+r殶sdgVæ2ôuT7G&ÄvWDW7GÆRb33c´7G&ÆvæB¢bæ÷B4væBb33c´7G&ÆvæBFVâb33c´7G&ÆvæBÒuT7G&ÄvWDæFÆRb33c´7G&ÆvæB¢Æö6Âb33c¶ôW7GÆRÒFÆÄ6ÆÂgV÷C·W6W#3"æFÆÂgV÷C²ÂgV÷C¶ÆöærgV÷C²ÂgV÷C´vWEvæF÷tÆöærgV÷C²ÂgV÷C¶væBgV÷C²Âb33c´7G&ÆvæBÂgV÷C¶çBgV÷C²ÂÓ#¶vWBW7FærW7GÆP¢&WGW&âb33c¶ôW7GÆU³Ð¤VæDgVæ2³ÓÒfwCµôuT7G&ÄvWDW7GÆP
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