I tried to add autoCompleteSource in vb.net textbox so it displays a list of suggestion. But I get this error.
Is it because I try to add more than 300 records in suggestion . If so what can I do to add a scroll bar to display the records in suggestion. I guess I'll be needing to create my own handler if so could you suggest me the properties to consider to add scroll bar to create my own textbox autocomplete.
[UPDATE]
Dim MySource As New AutoCompleteStringCollection()
lst.Add("apple")
lst.Add("applle")
lst.Add("appple")
lst.Add("appplee")
lst.Add("bear")
lst.Add("pear")
'Records binded to the AutocompleteStringCollection.
MySource.AddRange(lst.ToArray)
'My own data source with 300 records
Dim index(cmboList.Items.Count) As String
For i As Integer = 0 To cmboList.Items.Count - 1
If cmboList.Items.Count > 0 Then
index(i) = cmboList.Items(i).ToString()
End If
Next
MySource.AddRange(index.ToArray)
txtExpressionBuilder.AutoCompleteCustomSource = MySource
'Auto complete mode set to suggest append so that it will sugesst one
'or more suggested completion strings it has bith ‘Suggest’ and
'‘Append’ functionality
txtExpressionBuilder.AutoCompleteMode = AutoCompleteMode.Suggest ' SuggestAppend
'Set to Custom source we have filled already
txtExpressionBuilder.AutoCompleteSource = AutoCompleteSource.CustomSource