Click here to Skip to main content
15,913,773 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: menuitem name Pin
ccotton33330-Jun-04 11:20
ccotton33330-Jun-04 11:20 
GeneralRe: menuitem name Pin
Nick Parker30-Jun-04 12:00
protectorNick Parker30-Jun-04 12:00 
GeneralGet index of selected item in Listbox Pin
Glen Conaway30-Jun-04 6:36
Glen Conaway30-Jun-04 6:36 
GeneralRe: Get index of selected item in Listbox Pin
ccotton33330-Jun-04 10:45
ccotton33330-Jun-04 10:45 
GeneralRe: Get index of selected item in Listbox Pin
ccotton33330-Jun-04 10:46
ccotton33330-Jun-04 10:46 
GeneralRe: Get index of selected item in Listbox Pin
Name Removed30-Jun-04 11:40
Name Removed30-Jun-04 11:40 
GeneralRe: Get index of selected item in Listbox Pin
Glen Conaway30-Jun-04 13:21
Glen Conaway30-Jun-04 13:21 
GeneralCombo Box Filter Pin
lildragon30-Jun-04 5:53
lildragon30-Jun-04 5:53 
Hi I am trying to create a combobox that will filter out items found in an items collection as the user enters each character. This combo box will also need to display the items within the items collection as well. I have found code that will allow me to autofill the combo box and to display the items in the collection, but have not had any luck in coding or finding code that will allow me to filter out these items. Any suggestions? Thanks.
The code found so far:
Public Sub AutoCompleteCombo_keyUp(ByVal sender As Object, ByVal e As KeyEventArgs)
Dim cbo As ComboBox = sender
Dim sTypedText As String
Dim iFoundIndex As Integer
Dim oFoundItem As Object
Dim sFoundText As String
Dim sAppendText As String
Dim boxIndex As Integer, lExst As Boolean
Dim posCursor As Integer = cbo.SelectionStart

' If Cursor does not stay on the beginning of text box.
If posCursor <> 0 Then
lExst = False

'Allow select keys without Autocompleting
Select Case e.KeyCode
Case Keys.Back, Keys.Left, Keys.Right, Keys.Up, Keys.Delete, Keys.Down
Return
End Select

If e.KeyCode = Keys.Enter Then
cbo.Height = 21
'RaiseEvent Submit(Me, e.Empty)
Exit Sub
End If

'Get the Typed Text and Find it in the list
sTypedText = cbo.Text
iFoundIndex = cbo.FindString(sTypedText)

'If we found the Typed Text in the list then Autocomplete
If iFoundIndex >= 0 Then
If cbo.Text <> "" Then
'cbo.DataSource().GetType.mDataViewCombo.RowFilter = cbo.DisplayMember & " LIKE '" & Me.Text & "%'"
Else
'mDataViewCombo.RowFilter = ""
End If
'Get the Item from the list (Return Type depends if Datasource was bound
' or List Created)
oFoundItem = cbo.Items(iFoundIndex)
'Use the ListControl.GetItemText to resolve the Name in case the Combo
' was Data bound
sFoundText = cbo.GetItemText(oFoundItem)

'Append then found text to the typed text to preserve case
sAppendText = sFoundText.Substring(sTypedText.Length)
cbo.Text = sTypedText & sAppendText

'Select the Appended Text
cbo.SelectionStart = sTypedText.Length
cbo.SelectionLength = sAppendText.Length
End If
End If
End Sub
GeneralRe: Combo Box Filter Pin
ccotton33330-Jun-04 10:56
ccotton33330-Jun-04 10:56 
GeneralRe: Combo Box Filter Pin
lildragon30-Jun-04 11:39
lildragon30-Jun-04 11:39 
GeneralRe: Combo Box Filter Pin
Ravi S.V.30-Jun-04 21:36
Ravi S.V.30-Jun-04 21:36 
GeneralRe: Combo Box Filter Pin
Anonymous1-Jul-04 6:55
Anonymous1-Jul-04 6:55 
GeneralRe: Combo Box Filter Pin
Serge Lobko-Lobanovsky1-Jul-04 4:17
Serge Lobko-Lobanovsky1-Jul-04 4:17 
GeneralRe: Combo Box Filter Pin
Anonymous1-Jul-04 7:03
Anonymous1-Jul-04 7:03 
GeneralNew Combo Box Filter Pin
lildragon5-Jul-04 8:09
lildragon5-Jul-04 8:09 
GeneralLatest ComboBox Filter Code Pin
lildragon5-Jul-04 10:42
lildragon5-Jul-04 10:42 
GeneralInserting Image into Richtext Box Control Pin
Harish Bailwad30-Jun-04 1:41
Harish Bailwad30-Jun-04 1:41 
GeneralRe: Inserting Image into Richtext Box Control Pin
Dave Kreskowiak30-Jun-04 12:06
mveDave Kreskowiak30-Jun-04 12:06 
GeneralInserting Image into Richtext Box Control Pin
hari_vb30-Jun-04 1:41
susshari_vb30-Jun-04 1:41 
GeneralDrag URL -&gt; Drop File Pin
Timotei_Younge29-Jun-04 23:16
Timotei_Younge29-Jun-04 23:16 
GeneralRe: Drag URL -&gt; Drop File Pin
Dave Kreskowiak30-Jun-04 2:42
mveDave Kreskowiak30-Jun-04 2:42 
Questionhow to put an exe file into vb6.0 Pin
saimram29-Jun-04 19:36
saimram29-Jun-04 19:36 
AnswerRe: how to put an exe file into vb6.0 Pin
Dave Kreskowiak30-Jun-04 2:39
mveDave Kreskowiak30-Jun-04 2:39 
Generaldata type error Pin
GaryKoh29-Jun-04 16:50
GaryKoh29-Jun-04 16:50 
GeneralRe: data type error Pin
Dave Kreskowiak30-Jun-04 0:38
mveDave Kreskowiak30-Jun-04 0:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.