Jump to content

Which function shows us when the Input lost focus?


Recommended Posts

It is like <input type="text" onfocus="" onblur="">.

Could anyone help me plz, show me the way to do that using AutoIt with GUICtrlCreateInput!

for(loop=0; loop<infinity; loop++) { alert('I love you'); }

Link to comment
Share on other sites

Link to comment
Share on other sites

Mate its a good suggestion. You haven't provided any example code (in AutoIt)...

Something like this could be adapted to your needs.

$old_focus = ""
$GUI = GUICreate ("Test", 200, 150)
$hInput = GUICtrlCreateInput ("Input 1", 10, 10, 130)
$hInput2 = GUICtrlCreateInput ("Input 2", 10, 35, 130)
$hInput3 = GUICtrlCreateInput ("Input 3", 10, 60, 130)
GUISetState ()

While 1
    $nMsg = GUIGetMsg ()
    Switch $nMsg
        Case -3
            Exit
    EndSwitch
    $focused_Control = ControlGetFocus($GUI)
    If $focused_Control <> $old_focus Then
        MsgBox (0, "",  "'" & ControlGetText ($GUI, "", $focused_Control) & "' gained focus" & @CRLF & _
                        "'" & ControlGetText ($GUI, "", $old_focus) & "' lost focus")
        $old_focus = $focused_Control
    EndIf
WEnd

But you can adapt it.

Cheers,

Brett

Link to comment
Share on other sites

Mate its a good suggestion. You haven't provided any example code (in AutoIt)...

Something like this could be adapted to your needs.

$old_focus = ""
$GUI = GUICreate ("Test", 200, 150)
$hInput = GUICtrlCreateInput ("Input 1", 10, 10, 130)
$hInput2 = GUICtrlCreateInput ("Input 2", 10, 35, 130)
$hInput3 = GUICtrlCreateInput ("Input 3", 10, 60, 130)
GUISetState ()

While 1
    $nMsg = GUIGetMsg ()
    Switch $nMsg
        Case -3
            Exit
    EndSwitch
    $focused_Control = ControlGetFocus($GUI)
    If $focused_Control <> $old_focus Then
        MsgBox (0, "",  "'" & ControlGetText ($GUI, "", $focused_Control) & "' gained focus" & @CRLF & _
                        "'" & ControlGetText ($GUI, "", $old_focus) & "' lost focus")
        $old_focus = $focused_Control
    EndIf
WEnd

But you can adapt it.

Cheers,

Brett

It worked, thanks!

for(loop=0; loop<infinity; loop++) { alert('I love you'); }

Link to comment
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
 Share

  • Recently Browsing   0 members

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