Hello guys,
I am trying to find how to execute a calculation function when the user leaves the active GUI control - and didnt find solutions with Google and forums search with the keywords I used...
So, as an example - I want to use this instead of relying on hotkeys like Tab or Enter that are normally used to validate an input.
The goal is to expand the catch possibilities to validate ANYTIME the active gui control is not active anymore. This way the function to calculate new values will be called no matter what happens as soon as the control looses focus that it previously had when the user was typing values inside. But it will not do so in real time like with a gLabel only when leaving control.
Please, what would be the way to do that?
Thanks for your help in advance !
Alex
How to detect if user left the active gui control?
Re: How to detect if user left the active gui control?
Code: Select all
#SingleInstance, Force
#Persistent
FocusedCtl := "" ; Initialize variable
PrevFocusedCtl := "" ; Initialize variable
Gui, Margin, 10, 10
Gui, Add, Edit, w200 r1 vEdit1
Gui, Add, Edit, w200 r1 vEdit2
Gui, Add, Edit, w200 r10 vEdit3
Gui, Show, AutoSize, Example
SetTimer, Timer1, 100
return
Timer1:
GuiControlGet, FocusedCtl, FocusV
If (FocusedCtl <> PrevFocusedCtl) {
GuiControl,, Edit3, % FocusedCtl
TrayTip,, % FocusedCtl
ToolTip, % FocusedCtl
}
PrevFocusedCtl := FocusedCtl
return
Re: How to detect if user left the active gui control?
wow cool Dewd! It was easier than I thought man! I guess settimer is similar to having a super complex OnMessage added to the script right?
Thank you so much, I'll try implementing that but as for what it seems, it will probably be perfect.
Thank you so much, I'll try implementing that but as for what it seems, it will probably be perfect.
Who is online
Users browsing this forum: Lamron750 and 235 guests