Capture Enter key from keyboard

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

One more quick question. When I tab to the Enter button I have added, I want
to push the enter button on the device keyboard. I need the on-click of my
enter button to fire when that happens.

How can I do this?

Thanks,
Steve
 
Well, there are numerous possibilities. If the button has the focus, you'll
probably have to catch the WM_KEYDOWN message and act (your code to catch it
will have to know whether the Enter button is focused or not). I'd do this
by using ApplicationEx from OpenNETCF as my application class, and an
IMessageFilter subclass (also OpenNETCF), to look for WM_KEYDOWN events. If
the IMessageFilter subclass has a reference to your form, it can check
whether the Enter button has the focus and, if it does, and if the key down
is Enter, it can send the on-click event.

Paul T.
 
Paul,

I have a similar question. I am entering text into a TextBox using the SIP
on a PocketPC. I can reflect data back to a Label control, so the SIP
control is working. I would like to hit the <Enter> key and have the SIP
become disabled. However, the SIP does not have an event for the <Enter>
key. I am getting ready to try using WM_KEYDOWN in VB as you've suggested
but have a nagging feeling this is a tough way to accomplish the task at hand.

Kent L.
 
Are we talking about a real SIP? Can't you use a method of the InputPanel
(or something like that; all of our devices have keyboards, so I'm not an
expert on what you do to control a SIP), to turn the SIP off?

Paul T.
 
Paul,

Yes, this is a real SIP. There don't seem to be any methods available with
the SIP, or else I'm missing how to locate them. I'm quessing that since
it's the compact framework that I'll have to do more work. I used the
Key_Down method to determine that the enter key was pressed to accomplish the
same task. But, like you, I would have thought a "enter" pressed method
would be available.

Regards, drumred
 
You have an InputPanel object on your form? That's what would be your
interface to the SIP...

Paul T.
 
Back
Top