VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



This code enables computer type ahead when you type in a combo box.

by Sqares Solutions Company (1 Submission)
Category: Custom Controls/Forms/Menus
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Fri 7th January 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

This code enables computer type ahead when you type in a combo box.

Rate This code enables computer type ahead when you type in a combo box.



  Dim i As Integer, iPos As Integer
  If ctlCombo.Text > cSpace0 Then
    For i = 0 To ctlCombo.ListCount - 1
      If InStr(LCase(ctlCombo.List(i)), LCase(ctlCombo.Text)) = 1 Then
        iPos = Len(ctlCombo.Text)
        ctlCombo.Text = ctlCombo.List(i)
        If (Len(ctlCombo.Text) - iPos) > 0 Then
          ctlCombo.SelStart = iPos
          ctlCombo.SelLength = Len(ctlCombo.Text) - iPos
        End If
        Exit For
      End If
    Next
  End If
End Sub


Download this snippet    Add to My Saved Code

This code enables computer type ahead when you type in a combo box. Comments

No comments have been posted about This code enables computer type ahead when you type in a combo box.. Why not be the first to post a comment about This code enables computer type ahead when you type in a combo box..

Post your comment

Subject:
Message:
0/1000 characters