hi all
im trying to make a combo box that shrinks as you type
but then if you typed a letter that was the first letter of something in the list it would jump to it
this what i have
im trying to make a combo box that shrinks as you type
VB.NET:
Private Sub ComboBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyDown
ComboBox1.DroppedDown = False
ComboBox1.DroppedDown = True
End Sub
this what i have
VB.NET:
Private Sub ComboBox1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyDown
ComboBox1.DroppedDown = True
End Sub
Private Sub ComboBox1_KeyUp(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles ComboBox1.KeyUp
If e.KeyValue = 40 Or e.KeyValue = 38 Then
ComboBox1.DroppedDown = True
ElseIf e.KeyValue = 13 Then
ComboBox1.DroppedDown = False
Else
'---------------refresh combo box on form1-----------------
'Form1.ComboBox1.Text = ""
ComboBox1.Items.Clear()
RichTextBox1.Clear()
Rec.Open("SELECT * FROM Passwords WHERE Name like '%" & ComboBox1.Text & "%' ORDER by Name", Conn, ADODB.CursorTypeEnum.adOpenDynamic, ADODB.LockTypeEnum.adLockOptimistic)
While Not Rec.EOF
ComboBox1.Items.Add(Rec.Fields("Name").Value)
Rec.MoveNext()
End While
Rec.Close()
'----------------------------------------------------------
ComboBox1.SelectionStart = ComboBox1.Text.Length
ComboBox1.DroppedDown = True
End If
End Sub