Auto-complete selection
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 11 of 11

Thread: Auto-complete selection

  1. #1
    Join Date
    Aug 2002
    Posts
    640

    Auto-complete selection

    Hi, ALL,
    Is there a way to know when the auto-complete combo box selection occurs? Either by mouse click or "Enter" press.

    It doesn't look like it is from looking here. But maybe there is some hidden way?

    Thank you.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    18,963

    Re: Auto-complete selection

    Sorry, it is not clear what exactly you need to know/detect...
    Victor Nijegorodov

  3. #3
    Join Date
    Aug 2002
    Posts
    640

    Re: Auto-complete selection

    Hi, Victor,
    Quote Originally Posted by VictorN View Post
    Sorry, it is not clear what exactly you need to know/detect...
    Create a text control with the auto-completion.
    Start typing - autocompletion window pops-up.
    Hit enter on one of the choices.

    At this point is there any messages sent to notify me that the text is changed?
    I.e., can I detect that the auto-completion selection was made and the text is changed?

    Thank you.

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    18,963

    Re: Auto-complete selection

    One of the possible ways would be: subclass this "popup autocompletion window" and handle the "selection changed" (in case it is a listbox) or some similar notification for other window type.
    Victor Nijegorodov

  5. #5
    Join Date
    Aug 2002
    Posts
    640

    Re: Auto-complete selection

    Hi,
    Quote Originally Posted by VictorN View Post
    One of the possible ways would be: subclass this "popup autocompletion window" and handle the "selection changed" (in case it is a listbox) or some similar notification for other window type.
    Yes, I feared that there is no Windows way to handle this situation.

    Thank you.

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    18,963

    Re: Auto-complete selection

    Quote Originally Posted by OneEyeMan View Post
    Hi,


    Yes, I feared that there is no Windows way to handle this situation.

    Thank you.
    So where this "popup autocompletion window" comefrom and how?
    What type of a "text control with the auto-completion" do you use?
    Victor Nijegorodov

  7. #7
    Join Date
    Aug 2002
    Posts
    640

    Re: Auto-complete selection

    Hi,
    Quote Originally Posted by VictorN View Post
    So where this "popup autocompletion window" comefrom and how?
    This is the link.

    Quote Originally Posted by VictorN View Post
    What type of a "text control with the auto-completion" do you use?
    Just a regular text edit control from the standard windows classes described here.

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    18,963

    Re: Auto-complete selection

    Then no idea. Sorry!
    Victor Nijegorodov

  9. #9
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    12,573

    Re: Auto-complete selection

    OneEyeMan, have you checked the Windows SDK for a sample?

  10. #10
    Join Date
    Jan 2009
    Posts
    192

    Re: Auto-complete selection

    Do you want something like this:
    https://www.codeproject.com/Articles...nded-CComboBox
    ?

  11. #11
    Join Date
    Jan 2009
    Posts
    192

    Re: Auto-complete selection

    If you run the example from above, you will see CBN_SELENDOK notification code:
    https://msdn.microsoft.com/en-us/lib...(v=vs.85).aspx
    "Sent when the user selects a list item, or selects an item and then closes the list."

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


On-Demand Webinars (sponsored)