JScript Posted March 22, 2011 Posted March 22, 2011 (edited) Hello, Anyone could tell me how can I make for a GUICtrlCreateEdit() be enabled only when I click the mouse over him, and when I click out it disable? Edited March 23, 2011 by jscript http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
bogQ Posted March 22, 2011 Posted March 22, 2011 (edited) #Include <Misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> $gui = GUICreate("My GUI edit") ; will create a dialog box that when displayed is centered $myedit = GUICtrlCreateEdit("First line" & @CRLF, 176, 32, 121, 97, $ES_AUTOVSCROLL + $WS_VSCROLL) GUISetState() $state = 0 GUICtrlSetState($myedit,$GUI_DISABLE) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop If _IsPressed("01") Then $over = GUIGetCursorInfo ( $gui ) If $over[4] = $myedit Then If Not $state Then $state = 1 GUICtrlSetState($myedit,$GUI_ENABLE) EndIf Else If $state Then $state = 0 GUICtrlSetState($myedit,$GUI_DISABLE) EndIf EndIf Do Sleep(10) Until Not _IsPressed("01") EndIf Sleep(10) WEnd Edited March 22, 2011 by bogQ 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.
JScript Posted March 22, 2011 Author Posted March 22, 2011 more or less it... But the rest of the code blocks. Do Sleep(10) Until Not _IsPressed("01") http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
JScript Posted March 22, 2011 Author Posted March 22, 2011 I thought something like this: GUIRegisterMsg() http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
bogQ Posted March 22, 2011 Posted March 22, 2011 that was example, this isnt copy paste site That can b solved with one or two "If" if you know how 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.
JScript Posted March 23, 2011 Author Posted March 23, 2011 that was example, this isnt copy paste site That can b solved with one or two "If" if you know how Their example was very useful, a few changes after I came to this conclusion: expandcollapse popup#include <Misc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> Global $hGUI, $hEdit $hGUI = GUICreate("My GUI edit") $hEdit = GUICtrlCreateEdit("", 117, 37, 206, 89, BitOR($ES_AUTOVSCROLL, $ES_MULTILINE, $ES_WANTRETURN, $WS_VSCROLL)) GUICtrlSetState($hEdit, $GUI_DISABLE) GUISetState() _GuiLoop() Func _GuiLoop() Local Static $IsEnable = 0 While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_PRIMARYDOWN Local $aIsOver = GUIGetCursorInfo($hGUI) If $aIsOver[4] = $hEdit Then If Not $IsEnable Then $IsEnable = 1 GUICtrlSetState($hEdit, $GUI_ENABLE) GUICtrlSetState($hEdit, $GUI_FOCUS) EndIf Else If $IsEnable Then $IsEnable = 0 GUICtrlSetState($hEdit, $GUI_DISABLE) EndIf EndIf EndSwitch WEnd EndFunc ;==>_GuiLoop No need use the functions: _IsPressed() or Sleep. I thank you! http://forum.autoitbrasil.com/ (AutoIt v3 Brazil!!!) Somewhere Out ThereJames Ingram Download Dropbox - Simplify your life!Your virtual HD wherever you go, anywhere!
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