Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

How to Use KeyDown Event with the Combo Box Control

Avatar of DeniseGoodheart
DeniseGoodheart asked on
.NET ProgrammingVisual Basic.NET
11 Comments1 Solution1654 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,

Avatar of team2005

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

This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answers