Form.KeyPreview in CF

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
 
C

chris-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
 
S

s_alexander04

"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
 
P

Paul G. Tobey [eMVP]

Then it sounds like you should use the SDK and not the wedge.

Paul T.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top