I implemented auto complete in vb.net textbox , but there is an issue that when user types something in text box the auto complete suggestion list blinks and disappears like if the focus changed
here is the code:
Dim Bl As New ItemBL
Dim suggestions = DAL.DisplayLikeNameList(Trim(MyTextBox.Text))
Dim MySource As New AutoCompleteStringCollection()
MySource.AddRange(suggestions.ToArray)
With MyTextBox
.AutoCompleteCustomSource = MySource
.AutoCompleteMode = AutoCompleteMode.Suggest
.AutoCompleteSource = AutoCompleteSource.CustomSource
End With
End If
I believe the problem in Mdi form because it has timer code executed after the above code :
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
LblDateAndTime.Text = Now
End Sub
Note: the auto complete code is executed in a child form not in the Mdi Form , what do you suggest to keep suggestions list "sticky" as the user writing in the text box ??
I solved the issue ,
This Code was written in
Key_Up
event but now I wrote it inText_Changed
Event and it worked