Click here to Skip to main content
15,894,540 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want an event that will allow the user to tyoe few characters in the combobox and the combox will the corresponding item from its listitems. i am missing in the code
thanks

What I have tried:

private sub combobox1_keypress(keyAscii as integer)
if keypress=13 then
  .............
..............        
.................
endif
endsub
Posted
Updated 12-Jul-20 21:10pm

1 solution

Perhaps you take first a look how Events from Controls are generally realized.
But, of course, here is a code-sample :
VB
Private Sub ComboBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBox1.KeyPress
        If Asc(e.KeyChar) = Keys.Enter Then
            ' do something
        End If
End Sub
 
Share this answer
 
Comments
ashlytech 6-Aug-20 17:16pm    
Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900