I have auto complete functionality in combo box ,it works properly but there is little issue ,I made the suggestion list appear for the text length more than 3 chars ,but the list appears after the length of 4 char (when user enters the fifth char of the text) which means when the code executed in the first time the list doesn't appear here is the code in Text_Changed
Event
Private Sub TxtItem_TextChanged(sender As System.Object, e As System.EventArgs) Handles TxtItem.TextChanged
If Trim(TxtItem.Text) <> "" And Trim(TxtItem.Text).Length > 3 Then
'Autocomplete
Dim Bl As New ItemBL
Dim suggestions = Bl.DisplayLikeNameList(Trim(TxtItem.Text))
Dim MySource As New AutoCompleteStringCollection()
MySource.AddRange(suggestions.ToArray)
With TxtItem
.AutoCompleteMode = AutoCompleteMode.Suggest
.AutoCompleteSource = AutoCompleteSource.CustomSource
.AutoCompleteCustomSource = MySource
End With
TxtItem.Select(TxtItem.Text.Length, 0)
Exit Sub
Else
TxtItem.AutoCompleteMode = AutoCompleteMode.None
End If
End Sub
Note : This issue causes the application exit (sometimes) on Windows XP, but Doesn't affect on Windows 7