|
-
Sep 21st, 2007, 06:51 PM
#1
Thread Starter
Frenzied Member
[RESOLVED] Texttbox Autocomplete Source From Listbox
Is it possible to have a texttbox autocomplete source set to a listbox's collection?
I see:
FileSystem
HistoryList
RecentlyUsedList
AllUrl
AllSystemSources
FileSystemDirectories
CustomSource
in the texxtbox's autocompletesource property but are unable to make it happin.
regards
toe
-
Sep 21st, 2007, 08:00 PM
#2
Re: Texttbox Autocomplete Source From Listbox
You would select CustomSource, then add the items in the ListBox to the AutoCompleteCustomSource, e.g.
vb.net Code:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.SetCompleteList(Me.TextBox1, Me.ListBox1.Items)
End Sub
Private Sub SetCompleteList(ByVal tb As TextBox, ByVal list As IList)
Dim source As New AutoCompleteStringCollection
For Each item As Object In list
source.Add(item.ToString())
Next item
tb.AutoCompleteCustomSource = source
End Sub
-
Sep 21st, 2007, 08:44 PM
#3
Thread Starter
Frenzied Member
Re: Texttbox Autocomplete Source From Listbox
-
Dec 9th, 2011, 03:34 PM
#4
Addicted Member
Re: [RESOLVED] Texttbox Autocomplete Source From Listbox
Hi there
sorry to dig this up!
But this problem is exactly what I'm seeking the solution to, however I'm not sure which controls to name as which, in order to get this solution to work.
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|