jercfd Posted August 27, 2008 Share Posted August 27, 2008 How would I detect a change on an edit control. For example, when I type something into the edit control, it will do a function but when not typing, it will not. I know that putting the function in the While section will work but I do not want to always call it when typing is inactive. Link to comment Share on other sites More sharing options...
dbzfanatic Posted August 27, 2008 Share Posted August 27, 2008 Add Case $editname To your while and add your function code under it. 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] Link to comment Share on other sites More sharing options...
jercfd Posted August 27, 2008 Author Share Posted August 27, 2008 Add Case $editname To your while and add your function code under it.That way only works if I press enter on the edit control. I want the information to be displayed instantly. Link to comment Share on other sites More sharing options...
BAM5 Posted August 27, 2008 Share Posted August 27, 2008 (edited) You could do aGUICtrlReadoÝ÷ ÚÚ+zÚâz÷çZµ«azw(«z+m£Z·¬¦·¯¬,+Û^LZ^jëh×6If GUICtrlRead($editname) = $old Then [indent]$old=GUICtrlRead($editname)[/indent] Else [indent]$old=GUICtrlRead($editname) TheFunction()[/indent] EndIf (WHY DO YOU FAIL ME INDENT TABS?!?! WHY!?!?!?!) You'd put the above code in your while and be sure to say something like $old="" or Local $old before the while so you don't get an error that the variable doesn't exist. Edited August 27, 2008 by bam5 [center]JSON Encoding UDF[/center] Link to comment Share on other sites More sharing options...
jercfd Posted August 27, 2008 Author Share Posted August 27, 2008 I know your code will work but I don't always want to see if it has changed. It will cause higher CPU usage. I'm not too sure if it is possible but can you use GUIRegisterMsg. Link to comment Share on other sites More sharing options...
rasim Posted August 27, 2008 Share Posted August 27, 2008 jercfdTry this:#include <GuiConstantsEx.au3> #include <EditConstants.au3> #include <WindowsConstants.au3> $hGui = GUICreate("Test GUI", 300, 200) $hEdit = GUICtrlCreateEdit("", 10, 10, 280, 180) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUISetState() While GUIGetMsg() <> -3 ; WEnd Func WM_COMMAND($hWnd, $Msg, $wParam, $lParam) Local $IdFrom, $iCode $IdFrom = BitAnd($wParam, 0x0000FFFF) $iCode = BitShift($wParam, 16) Switch $IdFrom Case $hEdit Switch $iCode Case $EN_UPDATE ConsoleWrite("!> Changes on edit control detected" & @LF) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc 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