keydown event not working problem

G

GS

on a control, keydown was never triggered
Private Sub addressBar_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs)
....
end sub

on the hand the following got executed

Private Sub addressBar_textchanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles addressBar.TextChanged
wasUrlTyped = True
setStatus("address changed")
End Sub

BTW the adressbar1 is a combobox

do I have initialize something first?
 
C

Cor Ligthert [MVP]

GS,

I did not look at your code, however because it is mostly the situation that
the KeyUp will work, can you probably try that one first.

Cor
 
C

Chris Dunaway

GS said:
on a control, keydown was never triggered
Private Sub addressBar_KeyDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyEventArgs)
...
end sub

on the hand the following got executed

Private Sub addressBar_textchanged(ByVal sender As Object, ByVal e As
System.EventArgs) Handles addressBar.TextChanged
wasUrlTyped = True
setStatus("address changed")
End Sub

If this is your actual code, notice that there is a difference between
the two event handlers you posted. The TextChanged event has a Handles
keyword at the end of it wheras the KeyDown you posted does not.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top