hi,
i really don't know what exactly it is called :P , but i'll try to be clear on what i need.
i have a text box and a listbox. when the text box get focus, it loads the listbox and displays the content. What i need my code to do is, when i type something in the textbox, the LIKE words from the listbox gets highlighted. AND most importantly, when the user hit the 'down arrow key' from the from the keyboard i want the focus to shift to listbox AND with another key press (maybe enter key or something) the selected item from listbox get selected and displays in textbox.
Is this possible to achieve? or is it too much coding for newbie like me.
My texbox on focus code.
Private Sub txtItem_GotFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtItem.GotFocus
Try
Dim ds As New DataSet
Dim cmd As New OleDbCommand
Dim da As OleDbDataAdapter = Nothing
cmd.Connection = con
cmd.CommandText = "Select typeID,type From subtype"
da = New OleDbDataAdapter(cmd)
da.Fill(ds, "type")
With ListBox1
.DataSource = ds.Tables("type")
.DisplayMember = "type"
.ValueMember = "typeID"
.SelectedIndex = 0
End With
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
End Sub
if i'm too far behind from what i need, can someone please points me into the right direction. I know the above code has nothing to do with what i need as yet :P, as a matter of fact, i'v been VB-ing for only about 2 weeks. guidance will be highly appreciated :)