In firefly, how can I trap when a control (text box) looses focus?
Announcement
Collapse
No announcement yet.
firefly blur() event
Collapse
X
-
Look into WM_SETFOCUS/WM_KILLFOCUS messages. And, if any messages don't exist in the dropdown you can always add it in the CUSTOM message handler. One tool I use all the time is WinSpector to spy on a window or control and see what messages get sent, so I know what to trap and where to trap it (At form level or at control level).
Added:
Actually, in looking, it looks like in the edit controls it is sent as EN_Set/KillFocus messages too which FireFly uses in the dropdown, but either will work.Last edited by Roger Garstang; 20 Aug 2009, 03:11 PM.sigpic
Mobile Solutions
Sys Analyst and Development
-
Hi Shawn,
How are you testing for the KillFocus?
Code:'-------------------------------------------------------------------------------- Function FORM1_TEXT1_EN_KILLFOCUS ( _ ControlIndex As Long, _ ' index in Control Array hWndForm As Dword, _ ' handle of Form hWndControl As Dword, _ ' handle of Control idTextControl As Long _ ' identifier of text control ) As Long zTrace "Text1 Killfocus" End Function
Paul Squires
FireFly Visual Designer (for PowerBASIC Windows 10+)
Version 3 now available.
http://www.planetsquires.com
Comment
-
Originally posted by Shawn Anderson View PostNow I see that killFocus is called everytime anything happens, like click on another control.
How can I just call a function when that text box looses focus?
That does make sense that KillFocus will fire whenever the text box looses focus. If you click on another control then obviously the text box no longer has control so it will fire the KillFocus. Maybe you can send me the project or a sample that exhibits the problem and I'll be sure to give you a more specific reasoning for the behavior you're experiencing.Paul Squires
FireFly Visual Designer (for PowerBASIC Windows 10+)
Version 3 now available.
http://www.planetsquires.com
Comment
-
Hi Shawn,
The problem is the MsgBox stealing focus during the KillFocus of the Text Box. I am sending you a private email based on the project that you sent me.Paul Squires
FireFly Visual Designer (for PowerBASIC Windows 10+)
Version 3 now available.
http://www.planetsquires.com
Comment
-
The dreaded msgbox issues. I use them a lot for troubleshooting, but you do have to remember focus issues. Also for people that wrongly process keys on KeyUp (KeyDown is better and gives you repeat functionality)...msgbox doesn't eat the KeyUp and it gets sent to your control/form too.sigpic
Mobile Solutions
Sys Analyst and Development
Comment
Comment