My appologies for my short memory.
I think either you or Loyd gave me this answer already...
Set KeyPreview() = True at the form level to allow
catching arrow or any key downs regardless of where the
cursor focus is on the form
The following code fixes my keyfinder to work anywhere on
the form.
===================
Private Sub Form1_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
KeyPreview() = True ' Allows catching arrow
key at over all form level using Keydown event
End Sub
===================
[color=blue]
>-----Original Message-----
>Do you see any way using my example keycode finder so I
>don't have to put an Keydown event in each text box on[/color]
my[color=blue]
>form?
>
>I tried making a keycode event at the form level but[/color]
that[color=blue]
>did not seem to catch the arrow key when the cursor[/color]
focus[color=blue]
>is on a text box with in the form.
>
>
>[color=green]
>>-----Original Message-----
>>Thanks! your suggestion lead me to find the "Key
>>Enumeration" list. In VB .Net doing a search
>>on "KeyEventArgs.KeyCode Property" and then clicking
>>on "Keys" will bring up the complete list of keycodes.
>>
>>Among which are listed:
>>down Arrow returns 40
>>up arrow returns 38
>>left arrow returns 37
>>right arrow returns 39
>>
>>I found this code and fixed it to work right to verify
>>what keycode is returned on pressing down any key.
>>
>>It is pretty cool.
>>
>>First make a form and then drag a text box on to it.
>>Then paste this into the code.
>>
>>' ======================
>>
>> Private Sub TextBox1_KeyDown(ByVal sender As Object,
>>ByVal e As System.Windows.Forms.KeyEventArgs) Handles
>>TextBox1.KeyDown
>>
>> TextBox1.Text = "Key pressed was " & e.KeyCode
>> End Sub
>>' ======================
>>
>>
>>
>>
>>[color=darkred]
>>>-----Original Message-----
>>>"Bob Achgill" <anonymous@discussions.microsoft.com>[/color]
>>schrieb[color=darkred]
>>>> When I use the code for KeyPress to capture pressing[/color][/color][/color]
a[color=blue][color=green][color=darkred]
>>>> certain key for processing on a form with no Text[/color][/color][/color]
Box[color=blue][color=green]
>>it[color=darkred]
>>>> works.
>>>>
>>>> But when I try the same code on my application that[/color][/color]
>has[color=green][color=darkred]
>>>> text boxes it does does not work.
>>>>
>>>> How can I capture the cursor left and right keys for
>>>> processing?
>>>
>>>In addition to Lloyd, this might be of interest:
>>>
>>>
http://groups.google.com/groups?selm=40955b3b%240%[/color]
>>2424800%249b622d9e%40news.freenet.de[color=darkred]
>>>
>>>
>>>--
>>>Armin
>>>
>>>How to quote and why:
>>>
http://www.plig.net/nnq/nquote.html
>>>
http://www.netmeister.org/news/learn2quote.html
>>>
>>>.
>>>[/color]
>>.
>>[/color]
>.
>[/color]