Home All Groups Group Topic Archive Search About
Author
24 Mar 2006 10:31 PM
Rob
If I use the following code:

Private Sub Form1_KeyDown(ByVal sender As Object, _
    ByVal e As System.Windows.Forms.KeyEventArgs) _
    Handles MyBase.KeyDown

        Dim myKey As Integer

        myKey = e.KeyValue
        MsgBox(myKey.ToString)

End Sub

all of my keyboard input is displayed in the MsgBox,
However if I use any of the arrow keys the KeyDown
event handler no longer works ! All keyboard input is
no longer displayed in the MsgBox and the handler no
longer works. How can I rewrite the code to handle
arrow key input. Using Microsoft Development
Environment 2002    Version 7.0.9955

Author
24 Mar 2006 11:49 PM
Armin Zingler
Show quote Hide quote
"Rob" <rls_***@worldnet.att.net> schrieb
> If I use the following code:
>
> Private Sub Form1_KeyDown(ByVal sender As Object, _
>     ByVal e As System.Windows.Forms.KeyEventArgs) _
>     Handles MyBase.KeyDown
>
>         Dim myKey As Integer
>
>         myKey = e.KeyValue
>         MsgBox(myKey.ToString)
>
> End Sub
>
> all of my keyboard input is displayed in the MsgBox,
> However if I use any of the arrow keys the KeyDown
> event handler no longer works ! All keyboard input is
> no longer displayed in the MsgBox and the handler no
> longer works. How can I rewrite the code to handle
> arrow key input. Using Microsoft Development
> Environment 2002    Version 7.0.9955


Are there controls on the form? Which control has the focus when you press
the arrow key?


Armin
Author
25 Mar 2006 1:20 AM
Rob
Yes, there are 2 controls on the form. The form
contains a read only Text Box and a Button. Neither
control has a Tab stop. I want to use the
arrow keys to direct a cursor. The cursor is drawn
on the desktop by means of a C++ DLL.

Show quoteHide quote
"Armin Zingler" <az.nospam@freenet.de> wrote in message
news:eAML5C6TGHA.5172@TK2MSFTNGP12.phx.gbl...
> "Rob" <rls_***@worldnet.att.net> schrieb
> > If I use the following code:
> >
> > Private Sub Form1_KeyDown(ByVal sender As Object, _
> >     ByVal e As System.Windows.Forms.KeyEventArgs) _
> >     Handles MyBase.KeyDown
> >
> >         Dim myKey As Integer
> >
> >         myKey = e.KeyValue
> >         MsgBox(myKey.ToString)
> >
> > End Sub
> >
> > all of my keyboard input is displayed in the MsgBox,
> > However if I use any of the arrow keys the KeyDown
> > event handler no longer works ! All keyboard input is
> > no longer displayed in the MsgBox and the handler no
> > longer works. How can I rewrite the code to handle
> > arrow key input. Using Microsoft Development
> > Environment 2002    Version 7.0.9955
>
>
> Are there controls on the form? Which control has the focus when you press
> the arrow key?
>
>
> Armin
>