CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2000
    Location
    NM
    Posts
    122

    How can i get an event from the "On drop down close" or on drop down select?

    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



  2. #2
    Join Date
    Mar 1999
    Location
    Nepal
    Posts
    540

    Re: How can i get an event from the "On drop down close" or on drop down select?


    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.


  3. #3
    Join Date
    Oct 2000
    Location
    NM
    Posts
    122

    Re: How can i get an event from the "On drop down close" or on drop down select?

    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



  4. #4
    Join Date
    Dec 1999
    Location
    Dublin, Ireland
    Posts
    1,173

    Re: How can i get an event from the "On drop down close" or on drop down select?

    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
    '--8<-----------------------------------------
    NEW -The printer usage monitoring application
    '--8<------------------------------------------

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured