Announcement

Collapse
No announcement yet.

firefly blur() event

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Roger Garstang
    replied
    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.

    Leave a comment:


  • Paul Squires
    replied
    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.

    Leave a comment:


  • Shawn Anderson
    replied
    I will send you an example, thanks.

    It is not only "firing" when expected (when that control looses focus) but when any control looses focus.

    Leave a comment:


  • Paul Squires
    replied
    Originally posted by Shawn Anderson View Post
    Now 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?
    Hi Shawn,

    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.

    Leave a comment:


  • Shawn Anderson
    replied
    like this

    Code:
    Function OUTGOING_CONSIGNEDTO_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
                                               
    	MsgBox "test blur"                                           
    
    End Function

    Leave a comment:


  • Paul Squires
    replied
    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

    Leave a comment:


  • Shawn Anderson
    replied
    Now 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?

    Leave a comment:


  • Shawn Anderson
    replied
    killFocus is the ticket, thanks

    Leave a comment:


  • Roger Garstang
    replied
    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.

    Leave a comment:


  • Shawn Anderson
    started a topic firefly blur() event

    firefly blur() event

    In firefly, how can I trap when a control (text box) looses focus?
Working...
X