java glasspane

  • Thread starter Thread starter samlee
  • Start date Start date
S

samlee

Hello,
What is the C# equivalent of java setGlassPane(for capture all key and
mouse input)?

regards,
 
Hello,

Handling keyboard and mouse events I suppose? Of course there is no single
method to subscribe to all these events, you will have to subscribe to each
event individually.
 
Hi,
Handling keyboard and mouse events I suppose? Of course there is no
single method to subscribe to all these events, you will have to
subscribe to each event individually.

This doesn't always work. If I derive from Panel and I want to get the
MouseMove events, I won't always get them in OnMouseMove. If there's a
TextBox in the panel, the TextBox will get the events when the mouse is over
it (I haven't tried this exact case, but I'm pretty sure it's what happens).

To get all events and handle the ones you want, you can implement the
IMessageFilter interface. You should be able to find stuff on this on the
internet. The hard part is finding the message numbers (like WM_MOUSEMOVE),
for which you seem to have to download and install the platform SDK and then
scour the header files (usually WinUser.h).

Pete
 
Back
Top