Here's as close as you will come to the suggested functionality:
Code:
Gui, Add, Edit, vEdit1 gAutoSubmit
Gui, Add, Edit, vEdit2 gAutoSubmit
Gui, Add, Edit, vEdit3 gAutoSubmit
Gui Show
Loop 3
Hotkey F%A_Index%, Disp
return
Disp:
n := SubStr(A_ThisHotkey, 2)
MsgBox % Edit%N%
return
Edit1: ; called when the user changes the contents of Edit1
ToolTip % Edit1
return
AutoSubmit:
GuiControlGet, %A_GuiControl%
If IsLabel(A_GuiControl)
goto % A_GuiControl
return
Specify gAutoSubmit for the control's variable to update automatically. If a label with the same name as the control's variable is present, it will be launched immediately after the control's variable is updated. Of course, you could change the last few lines to add a naming convention such as variableName_Label: as opposed to variableName:
This has the same effect as calling GuiControlGet %A_GuiControl% in each of the gLabels; however it will save some lines of code if you have many 'AutoSubmit' controls.