PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Form.KeyPreview in CF

Reply

Form.KeyPreview in CF

 
Thread Tools Rate Thread
Old 05-03-2006, 04:33 PM   #1
s_alexander04@list.ru
Guest
 
Posts: n/a
Default Form.KeyPreview in CF


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

  Reply With Quote
Old 05-03-2006, 06:19 PM   #2
Daniel Moth
Guest
 
Posts: n/a
Default Re: Form.KeyPreview in CF

CF 2 or IMessageFilter. Discussed before:
http://groups.google.com/group/micr...d366ecbadab46a7

Cheers
Daniel
--
http://www.danielmoth.com/Blog/

<s_alexander04@list.ru> wrote in message
news:1141576421.097591.13730@i40g2000cwc.googlegroups.com...
> 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
>



  Reply With Quote
Old 06-03-2006, 12:27 PM   #3
chris-s@mailcity.com
Guest
 
Posts: n/a
Default Re: Form.KeyPreview in CF

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

What device is it?

Chris

  Reply With Quote
Old 06-03-2006, 07:18 PM   #4
s_alexander04@list.ru
Guest
 
Posts: n/a
Default Re: Form.KeyPreview in CF

"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

  Reply With Quote
Old 06-03-2006, 07:24 PM   #5
Paul G. Tobey [eMVP]
Guest
 
Posts: n/a
Default Re: Form.KeyPreview in CF

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

Paul T.

<s_alexander04@list.ru> wrote in message
news:1141672687.554995.58990@p10g2000cwp.googlegroups.com...
> "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
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off