Sign in to follow this  
Followers 0
au3scr

do func () on $edit1 change

3 posts in this topic

Hi all.

I am trying to run function every time $Edit1 is changed, but script made by koda dont work... I mean when I change text in $Edit1 then nothing happens.

What I need to do to have action on edit1 change?

I also tried Case $edit1.change as it is in most languages I've seen but thistime it didnt work.

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 202, 111, 193, 125)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 185, 89)
GUICtrlSetData(-1, "Edit1")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

        Case $Edit1
            do_Func ()          
    EndSwitch
WEnd

Func do_Func ()
MsgBox (1,"I Am function","which makes me cool")
EndFunc

Share this post


Link to post
Share on other sites

#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <Timers.au3>
$start=_Timer_Init()
$test = "Edit1"
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 202, 111, 193, 125)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 185, 89)
GUICtrlSetData(-1, "Edit1")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case _timer_diff($start) = 2
        If $test <> guictrlread($edit1) then
              do_Func ()     
              $test = guictrlread($Edit1)
              $start=_Timer_Init()
        Else
              $test = guictrlread($Edit1)
              $start=_Timer_Init()
        Endif
        
        Case $GUI_EVENT_CLOSE
            Exit

        
    EndSwitch
WEnd

Func do_Func ()
MsgBox (1,"I Am function","which makes me cool")
EndFunc


Giggity

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Thanks a lot, it works.

Where you learn such things? And how u know how mix functions to working thing.

Teach me please.

Edited by au3scr

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0