Jump to content
Sign in to follow this  
Monty

Determine which field is selected???

Recommended Posts

Monty

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
Andreik

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

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.