Sign in to follow this  
Followers 0
Monty

Determine which field is selected???

3 posts in this topic

Hi all, something very simple...how do you determine when field is selected (where edit is you cursor in)???

Can you please add to example below.

#include <GUIConstants.au3>
$appnamedata = "GUIName"
$gui_main = GUICreate($appnamedata, 400, 250)
$edit_1 = GUICtrlCreateEdit("", 10, 10, 300, 100)
$edit_2 = GUICtrlCreateEdit("", 10, 120, 300, 100)
GUISetState()
Do
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            GUIDelete()
    EndSelect
Until Not WinExists($gui_main)

Share this post


Link to post
Share on other sites



Use ControlGetFocus()

#include <GUIConstants.au3>
$appnamedata = "GUIName"
$gui_main = GUICreate($appnamedata, 400, 250)
$edit_1 = GUICtrlCreateEdit("", 10, 10, 300, 100)
$edit_2 = GUICtrlCreateEdit("", 10, 120, 300, 100)
GUISetState()
Do
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            GUIDelete()
    EndSelect
    TrayTip("Selected",ControlGetFocus($appnamedata),1)
Until Not WinExists($gui_main)

When the words fail... music speaks

Share this post


Link to post
Share on other sites
Thank you

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