Jump to content

Recommended Posts

Posted

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)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###



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

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)

_MyFunc()

Endif

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...