Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: Keypress for combobox


Message #1 by "Mort Barsky" <mort@s...> on Mon, 30 Dec 2002 22:59:44
Hi Mort,

I think you need the ComboBox1_KeyPress event

In the class dropdown box, go to ComboBox1 (or whatever you renamed it to),
then in the events dropdown, pick KeyPress

In the new sub, put

Select Case Asc(e.KeyChar)
Case 13
    ' Your Code Here
End Select


You could have "If Asc(e.KeyChar) <> 13 then Exit Sub", or "If
Asc(e.KeyChar) = 13 Then............End If", but it's worth the extra effort
now to make it flexible for the future.

Cheers,

Ian


  Return to Index