Handle key in all of application
-
hi i have the windows application and want when the user press esc the application exited but i don't know the focus now in the which control how can i do it ? MHF
You can set a keypreview property on the form, I thought, which means the form gets to preview all keys.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
You can set a keypreview property on the form, I thought, which means the form gets to preview all keys.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
MHASSANF wrote:
is there some things like this to mouse events ??
As far as I know there is nothing as easy as simply enabling
KeyPreview
. Instead you'll have to use hooks that however are well covered by many internet resources. You can start from this CP article Using Hooks from C#[^]
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
-
hi i have the windows application and want when the user press esc the application exited but i don't know the focus now in the which control how can i do it ? MHF