Combo Box Autofill 
Author Message
 Combo Box Autofill

Looking to build an autofill feature for a combo box.  Does anyone know of
an example of this?


Sat, 26 Nov 2005 21:28:39 GMT  
 Combo Box Autofill
i got it

dropdown=true and tab or enter will pull in the first value in the dropdown.


Quote:
> Looking to build an autofill feature for a combo box.  Does anyone know of
> an example of this?



Sat, 26 Nov 2005 23:16:26 GMT  
 Combo Box Autofill
I was meaning something like this as well.  

    Dim KeyPressed As String
    Dim iChar As Integer
    Private Sub ComboBox1_TextChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
ComboBox1.TextChanged
        'need to capture for the backspace and enter?
        '   Me.ComboBox1.DroppedDown = True
        'MyBase.OnTextChanged(e)

        Dim i As Integer
        i = Me.ComboBox1.FindString(KeyPressed)
        Try
            If i > -1 Then
                Me.ComboBox1.SelectedIndex = i
                Me.ComboBox1.SelectionStart = 0
                Me.ComboBox1.SelectionLength = iChar
            End If
        Catch

        End Try
    End Sub
    Private Sub ComboBox1_Enter(ByVal sender As Object,
ByVal e As System.EventArgs) Handles ComboBox1.Enter
        iChar = 0
        KeyPressed = ""
    End Sub

    Private Sub ComboBox1_KeyPress(ByVal sender As Object,
ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles
ComboBox1.KeyPress
        KeyPressed = KeyPressed & e.KeyChar
        iChar = KeyPressed.Length
    End Sub
End Class

Quote:
>-----Original Message-----
>i got it

>dropdown=true and tab or enter will pull in the first

value in the dropdown.
Quote:



>> Looking to build an autofill feature for a combo box.  
Does anyone know of
>> an example of this?

>.



Sun, 27 Nov 2005 02:43:06 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Autofill Fields on Selection in a Combo Box

2. enter data in a combo box based on value from another combo box

3. Limit subform combo box by selection in parent combo box

4. Want Access combo box to filter rowsource of another combo box

5. Populating a combo box from another combo box

6. Populate a combo box from another combo box selection

7. selecting records for 2nd combo box dependant on first combo box

8. Help filling second combo box from fist combo box

9. Combo box selection narrows next combo box choices

10. load 2nd combo box - depend on first combo box

11. Setting Combo box ListIndex initiates Combo box Click event

12. combo box/database combo box vlaue question - newbie

 

 
Powered by phpBB® Forum Software