Click to See Complete Forum and Search --> : How can i get an event from the "On drop down close" or on drop down select?


Codejoy
April 30th, 2001, 09:10 PM
We all know the combo boxes, and theres the on Change and on Lost focus, but I was curious if there was some way to get a On DropDown Close or something? The minute the user selects something from the list i can see what that something is, or is it a mater of combining on change and on lost focus intuitivly?

Shane

shree
April 30th, 2001, 09:34 PM
Do you mean the Click event? It occurs when the user clicks on an item in the combo's list. The dropdown closes on a click event, and the user has selected something.

If you want when the user clicked on the down arrow and the list dropped down, then there is the DropDown event.

Codejoy
April 30th, 2001, 10:02 PM
Hmm well actually I know there is a truedB combo control by APex (I dont have the money for that) and they had a On Dropdown closed. which handled all instances of a user selected something from the drop down, via drop down and select, drop down and use the arrows or typing it in. After they selected it or typed its completed state in the message would fire. I needed something like that. So i can have a item in the drop down the select and then display the information on the item the selected. (without having to have the combo box lose focus so I can fire the lose focus event, see whats in the .Text field fish it out of the database and then display it.)

Regards,
Shane

Clearcode
May 1st, 2001, 04:28 AM
This is a fairly tricky thing to do, I'm afraid.

What you need to do is subclass the parent form and watch for WM_COMMAND messages. Then if the HiWord is CBN_SELENDOK then the user has finished a combo selection operation.
This will fire before the combo loses focus so is equivalent to the trueDB's OnDropdownClosed message.

HTH,
Duncan

(For a simplification of subclassing, see the EventVB project at the Merrion Computing Ltd website)


-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com