Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

Execute OnComboClick with Enter key

Can this be done? Or even a separate event?

I want to execute code when the user selects something from the dropdown. I don't care how they select it, just that they have.
This is most prevalent with the use of autofill. If users are making use of the autofill capabilities, then they are typing, of which the natural extension is to hit 'Enter' when you've found the option you want rather than reach for the mouse just to click whatever is already highlighted.



  • Mark,

    As a work-around, would enabling the Always Tab Out on Enter feature and trapping the LOSTFOCUS event handler work for you?
  • Hey Don,

    Yep, that's what I'm doing.
    What's the difference then I hear you ask?

    I can't safely implement a promoted lostfocus event so I have to duplicate the lostfocus code in each commuter.
    We have one routine that initialises the combos based on certain generic types that we use everywhere.
    Correspondingly we have other fields that are likely to also be on every window where there are like combos.

    Simplest example is combos of key and description.
    User types in part of a description, finds the correct one in the list and we want to auto populate both the key and the description fields on the window. Can easily do this on the lostfocus.

    Better though to do it once in the promoted ole event routine as all the combos and corresponding fields will be named alike.

    Of course if we had a promoted lostfocus routine then the workaround would be just as good. But we don't so I was just kind of hoping.
  • Mark,

    So in the end you were hoping to capture this within an OLE event because that is safe to promote in this application but it is not safe to promote the LOSTFOCUS event handler? If I understood you correctly then I totally understand your hopes in this matter.
  • You understood. Too much lostfocus handling written for years before the concept of promoted events was considered.

    That said, in my little box I can't see any real value in the OnComboClick event. It's kind of half the job.
    Sure I can use it to send_event lostfocus but then the controls job is done so the user is going to move and do the lostfocus again anyway.
Sign In or Register to comment.