Results 1 to 3 of 3

Thread: Combo Box

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2000
    Location
    Dubai
    Posts
    24
    When we press a key how can we get the item which starts with that letter be selected?(Data is not in a recordset)

  2. #2
    Fanatic Member
    Join Date
    Sep 1999
    Location
    Bethel, North Carolina, USA
    Posts
    987

    Exclamation

    What is the STYLE property for the combo box set to? If you set it to 2 - Dropdown List then you don't have to do anything, it will do it for you.
    {Insert random techno-babble here}

    {Insert quote from some long gone mofo here}

  3. #3
    Addicted Member c@lle's Avatar
    Join Date
    Oct 1999
    Location
    Belgium
    Posts
    179
    eg: you can make an extra field (txtFind) where the user can type his text.
    When he does so, via the txtFind_Change event, you send this to your listbox so that the matching text is selected.

    Code:
    Public Declare Function sendMessageByString& Lib "user32" _
        Alias "SendMessageA" (ByVal hwnd As Long, _
        ByVal wMsg As Long, ByVal wParam As Long, _
        ByVal lParam As String)
    
    
    Private Sub txtFind_Change()
     Dim lngEntryNum As Long
     Dim strTxtToFind As String
    
        strTxtToFind = txtFind.Text
        lngEntryNum = sendMessageByString(List1.hwnd, &H18C, 0, strTxtToFind)
    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