Jump to content
Sign in to follow this  

Event on input change

Recommended Posts


I want to run a command everytime the $Input1 changes

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <ListBoxConstants.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ###
$Form1 = GUICreate("Form1", 622, 427, 193, 125)
$List1 = GUICtrlCreateList("", 24, 40, 257, 305)
$List2 = GUICtrlCreateList("", 304, 40, 249, 305)
$Input1 = GUICtrlCreateInput("", 24, 384, 177, 21)
$Button1 = GUICtrlCreateButton("Search", 216, 384, 97, 25, 0)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
        case $Input1
            GUICtrlSetData($List1, GUICtrlRead($Input1))

Share this post

Link to post
Share on other sites

Ah Forum ate my post!

Anyways. If you add the $SS_NOTIFY style to the input control it will set GUIGetMsg() to $Input1 everytime the the control content has changed and the user pressed "enter" or unfocussed the control.

If you want it to update on every change then compare the old content to the new in your main loop, like:

If GUICtrlRead($Input1) <> $OldInput Then

$OldInput = GUICtrlRead($Input1)



you can then do what you want to do in _MyFunc()

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.