Home All Groups Group Topic Archive Search About

keydown event not working problem

Author
7 Oct 2006 6:32 AM
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?

Author
8 Oct 2006 4:37 AM
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

Show quoteHide quote
"GS" <gsmsnews.microsoft.co***@msnews.Nomail.com> schreef in bericht
news:O5Dwwpd6GHA.4304@TK2MSFTNGP03.phx.gbl...
> 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?
>
>
Author
9 Oct 2006 2:31 PM
Chris Dunaway
GS wrote:
Show quoteHide quote
> 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.