When I press the Alt key, I no longer get MouseMove messages for my Windows Form until I press the Alt key again. How can I stop that from happening?
This doesn't happen for Shift or Ctrl, just Alt. It seems to be related to the Menu bar functionality. But I don't have a MenuBar in my windows form.
Steps to reproduce:
- Create a new windows forms application from the template (I'm working in C#)
- Open the designer for Form1. Open the properties window (F4) and go to the Event's tab (events button)
- Add a handler for Form1's MouseMove by double-clicking MouseMove in the property window.
- Add a TracePoint to the code for MouseMove (Add a breakpoint, and right-click the breakpoint, and choose "When Hit..." and check "Print a message" and "Continue execution")
- Run the app (F5)
- Move the mouse around on the form, Notice that the TracePoint messages are being displayed in the debugger's output window.
- Tap the Alt key.
- Move the mouse around on the form. Notice that there are no more TracePoint messages being displayed in the debugger's output window. :(
(NOTE: If you press the Alt key again, you'll get MouseMove messages again.)
How can I prevent this from happening so that I always get MouseMove messages even if the user happens to press and release Alt?