keydown event not working problem

  • Thread starter Thread starter GS
  • Start date Start date
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?
 
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
 
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.
 
Back
Top