About the Focused Form

  • Thread starter Thread starter steel
  • Start date Start date
S

steel

Thanks for your response. Paul.
The reason of a form always be focused is that: It can make the form
react with the FunctionKey at any time. In my device there are some
FunctionKeys and a small keyboard, the FuctionKeys should be responsed
at the instance the user push it. So I let the Form always Focused to
recieve all key event and dispatch the non-FunctionKey event to the
cotrol in it.

Does you has better solution?


thank you very much.
 
Paul, thanks a lot for your guidance. I have leant it,

The reason of a form always be focused is that: It can make the form
react with the FunctionKey at any time. In my device there are some
FunctionKeys and a small keyboard, the FuctionKeys should be responsed
at the instance the user push it. So I let the Form always Focused to
recieve all key event and dispatch the non-FunctionKey event to the
cotroll in it.

Does you has better solution?

your help will be very appreciated.
 
To make a form react to a function key, register a hot key and your form
will get a WM_HOTKEY message when the key is pressed. Again, you don't want
to steal the focus from things like Textbox controls or they won't work. I
think that there has been traffic previously that describes calling
RegisterHotKey() (which you have to P/Invoke), and handling the resulting
WM_HOTKEY message sent when the key is pressed.

You can search the archives of this group in:

http://groups.google.com/group/micr...tframework?hl=en&lr=lang_en&ie=UTF-8&oe=UTF-8

If you just search on RegisterHotKey, you'll find that there are limitations
to what you can register for, how to catch the message that results, etc.

Paul T.
 
Back
Top