Results 1 to 7 of 7

Thread: Combo Box

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    105

    Combo Box

    Dear Friends,

    Is there any idea to make VB Combo box to select an item by typing the first two or three letters.

    The VB combo box select item with first letter only.

    For example, I have a combo box added all country names. Now I want to select India by typing first two or three letters IN,China by typing CH, Sudan by typing SU etc.

    In the normal case VB combo box, if we type IN it selects a country name starting with N.

    So is there any idea to get this option in VB Combo box or is any third party combo box with this facility is available ?


    Regards
    Nasreen

  2. #2
    Frenzied Member
    Join Date
    Nov 2010
    Posts
    1,470

    Re: Combo Box

    this is normally done by capturing the input and running down the combobox until the first matching occurance

    so when you type at the combo box

    the change event triggers a search down the box for the first word starting with what you typed in

    does that help or do you ned more

    please rate my posts if they help

    here to talk

  3. #3

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    105

    Re: Combo Box

    Quote Originally Posted by incidentals View Post
    this is normally done by capturing the input and running down the combobox until the first matching occurance

    so when you type at the combo box

    the change event triggers a search down the box for the first word starting with what you typed in

    does that help or do you ned more

    please rate my posts if they help

    here to talk
    Could you please explain your idea by help of a sample code ?

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Apr 2005
    Posts
    105

    Re: Combo Box

    Quote Originally Posted by RhinoBull View Post

    Hi Rhinobull.

    I think the links directed by you are applicable for normal combo box ie. Style 0 (Dropdown combo), but in the case of style 2 (Dropdown List) it arise some error.

    In my projecct I need this auto complete system in Style 2 (Dropdown List) that forces user to select listed items only.

    Regards,
    Nasreen

  6. #6
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Combo Box

    Give the forum a quick search for: auto-complete combo or autocomplete combo
    You should get more examples to look at
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  7. #7
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Combo Box

    Quote Originally Posted by nasreen View Post
    Hi Rhinobull.

    I think the links directed by you are applicable for normal combo box ie. Style 0 (Dropdown combo), but in the case of style 2 (Dropdown List) it arise some error.

    In my projecct I need this auto complete system in Style 2 (Dropdown List) that forces user to select listed items only.

    Regards,
    Nasreen
    Try something as simple as this:
    Code:
    Private Sub Combo1_KeyPress(KeyAscii As Integer)
        If Not KeyAscii = 13 Then
            SendKeys "%{DOWN}"
        End If
    End Sub

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