Form.KeyPreview in CF

  • Thread starter Thread starter s_alexander04
  • Start date Start date
S

s_alexander04

Hello!
First, I'm using VS2003 with .NET CF.
I'm writing an application for PocketPC which uses bar code scanner.
Scanner reads bar code data into application as if it were manually
typed. On a form there are TextBox (into which bar code data is read)
and ListBox. Problems begin when ListBox has focus, then data from
scanner goes to nowhere. ListBox.KeyPress and other ListBox.Key* events
don't work. First my solution was to call TextBox.Focus() after each
ListBox.SelectedIndexChanged. But after, I saw that if ListBox is not
fully filled with items then when I tap on an empty space of ListBox I
didnt get ListBox.SelectedIndexChanged and TextBox lost focus.
Form.KeyPreview property coulde solve the problem but .NET CF doesn't
support it.
How to preview keyboard events before any control get them? Or any
solution of this problem if possible.

Thank you for reading and for your help !


Aleks S
 
Another thing that might help would be to 'turn-off' the scanner unless
the textbox does not have focus.

What device is it?

Chris
 
"Socket SDIO In-Hand Scan Card" scanner
or Opticon PHL5200 Pocket PC whith a built-in scanner.

The scanner must always be turned on and ready to scan while the
application is running. If you mean that user must manually set focus
to the textbox in case it hasn't, no it won't do. The application must
be simple and convenient for a user as much as possible.

Aleks
 
Back
Top