troubleshooting Question

How to Use KeyDown Event with the Combo Box Control

Avatar of DeniseGoodheart
DeniseGoodheart asked on
.NET ProgrammingVisual Basic.NET
11 Comments5 Solutions1654 ViewsLast Modified:
Good Day:

I am creating a WinForms application using VS.NET 2005 and VB.NET 2005.  I need to determine whether the user key pressed B or S in the combo box called cboType.  I get an error message that reads: Cannot handle event  keydown because they do not have the same signature.  I tried the following and get the same error.

Private Sub cboType_KeyDown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cboType.KeyDown
If e.KeyValue=keys.B then
'Do Something
End sub

Private Sub cboType_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles cboType.KeyPress
If e.KeyValuee=keys.S then
'Do Something
End Sub

Any Suggestions?
Thank You,


Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 5 Answers and 11 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 5 Answers and 11 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros