Since nobody has answered this, I'm going to post a response.
This example is in VB2005 (hey, it's better than nothing).
On the combobox:
Set AutoCompleteMode to SuggestAppend.
Set AutoCompleteSource to CustomSource.
Private Sub LoadManagerComboBox()
If MgrList IsNot Nothing AndAlso MgrList.Count 0 Then
MgrList = Nothing 'blank out the table
End If
MgrList = PTBO.ManagerList.Create("ManagerName")
'bind the combo box to the list
ManagerComboBox.DataSource = MgrList
ManagerComboBox.DisplayMember = "FullName"
ManagerComboBox.ValueMember = "UserID"
ManagerComboBox.SelectedIndex = -1
Call BuildAutoCompleteStrings()
End Sub
Private Sub BuildAutoCompleteStrings()
'If the manager list doesn't have any entries, return.
If MgrList.Count <= 0 OrElse ManagerComboBox.Items.Count <= 0 Then
Return
End If
' Clear what is in there now
ManagerComboBox.AutoCompleteCustomSource.Clear()
'Set the column name.
Dim filterField As String = "FullName"
' Build the list of filter values.
Dim filterVals As AutoCompleteStringCollection = _
New AutoCompleteStringCollection()
For Each dataItem As Object In MgrList
Dim props As PropertyDescriptorCollection = _
TypeDescriptor.GetProperties(dataItem)
Dim propDesc As PropertyDescriptor = _
props.Find(filterField, True)
Dim fieldVal As String = _
propDesc.GetValue(dataItem).ToString()
filterVals.Add(fieldVal)
Next
' Set the list on the collection.
ManagerComboBox.AutoCompleteCustomSource = filterVals
End Sub
Robin S.
------------------------------------------------
"John" <go*******@hotmail.comwrote in message
news:eB**************@TK2MSFTNGP02.phx.gbl...
Does anyone have some sample code for building a combobox that will
automatically list the remaining folders while you type? I'm looking
for functionality similar to the "Look in:" combobox in the Search
Companion panel in Windows Explorer. If you type "C:\" it will open
the drop down and fill it in with all of the directories on C:\. Then
as you type letters it will re-fill the drop down with only the
folders that match your typing.
Thanks,
John